Re: [Wicket-user] replace ognl.

2005-10-27 Thread Alexandru Popescu

#: Martijn Dashorst changed the world a bit at a time by saying on  10/27/2005 
7:28 AM :#

+1 on moving OGNL into extensions.

I think the OGNL thing is good, it provides a nice base
implementation. I'd like to see the current implementation still being
available for those 1% that need the full OGNL expression evaluator
(though I think I share the same sentiment Phil voiced).



This is exactly the way I would put my +1 :-).


Do we also support things like

person.getChildren().get(0).getName()?

Martijn




I guess this is: person.children.[0].name and Johan already mentioned it.

./alex
--
.w( the_mindstorm )p.


On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:

I'm very +1 on this. OGNL has turned into it's own scripting language
over the years. If you want to use any of those features, then you're
missing the point of Wicket.


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Juergen Donnerstag
I'm also +1 on moving OGNL into extension

 I guess this is: person.children.[0].name and Johan already mentioned it.

I think Johan mentioned, it'll be person.children.0.name

Juergen

On 10/27/05, Alexandru Popescu [EMAIL PROTECTED] wrote:
 #: Martijn Dashorst changed the world a bit at a time by saying on  
 10/27/2005 7:28 AM :#
  +1 on moving OGNL into extensions.
 
  I think the OGNL thing is good, it provides a nice base
  implementation. I'd like to see the current implementation still being
  available for those 1% that need the full OGNL expression evaluator
  (though I think I share the same sentiment Phil voiced).
 

 This is exactly the way I would put my +1 :-).

  Do we also support things like
 
  person.getChildren().get(0).getName()?
 
  Martijn
 
 

 I guess this is: person.children.[0].name and Johan already mentioned it.

 ./alex
 --
 .w( the_mindstorm )p.

  On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
  I'm very +1 on this. OGNL has turned into it's own scripting language
  over the years. If you want to use any of those features, then you're
  missing the point of Wicket.
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] replace ognl.

2005-10-27 Thread Maurice Marrink
Also +1
Actually our project is what triggerd this change and will bring some
new features we need. Nothing fancy though.

What I have gathered from johan it will be possible to get elements from
maps / lists / arrays etc.
The expression would be something like person.children.0.name It is very
similar if not the same syntax ognl uses. If children was a map
containing a key jack you could use person.children.jack.name



Maurice Marrink 
www.topicus.nl  

-Original Message-
From: Martijn Dashorst [mailto:[EMAIL PROTECTED] 
Sent: donderdag 27 oktober 2005 7:28
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] replace ognl.

+1 on moving OGNL into extensions.

I think the OGNL thing is good, it provides a nice base
implementation. I'd like to see the current implementation still being
available for those 1% that need the full OGNL expression evaluator
(though I think I share the same sentiment Phil voiced).

Do we also support things like

person.getChildren().get(0).getName()?

Martijn


On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
 I'm very +1 on this. OGNL has turned into it's own scripting language
 over the years. If you want to use any of those features, then you're
 missing the point of Wicket.


 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] RE: where to find any hibernate-wicket example ?

2005-10-27 Thread tkaczano
Thanks for all responses.
It's very encouraging to get immediate replies - it makes me believe that 
wicket is alive and has strong community, which is obviously a good thing.

Igor, your phonebook app is exactly what I've been looking for, thanks !

Tomek Kaczanowski


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner
yes i currently don't have support for { or [ or things like that.
Just plain text with dots. This makes it very easy and fast to parse.
but if people really want this:

person.children[0].name

does ognl has a special map _expression_? something like person.childeren{child1}.name ?
i know that it also works for just strings like Ognl.getValue(child1 , myHashMap);
so it all depends on what we really would like to see for array/list:

person.children.0.name
person.children.[0].name
person.children[0].name

and maps?

if we want [] in it then i just have to use a bit more logic like a tokenizer instead of just doing a plain indexOf loop

I like the simple approache i have now. .
On 10/27/05, Juergen Donnerstag [EMAIL PROTECTED] wrote:
I'm also +1 on moving OGNL into extension I guess this is: person.children.[0].name and Johan already mentioned it.I think Johan mentioned, it'll be person.children.0.name
JuergenOn 10/27/05, Alexandru Popescu [EMAIL PROTECTED] wrote: #: Martijn Dashorst changed the world a bit at a time by saying on10/27/2005 7:28 AM :#
  +1 on moving OGNL into extensions.   I think the OGNL thing is good, it provides a nice base  implementation. I'd like to see the current implementation still being  available for those 1% that need the full OGNL _expression_ evaluator
  (though I think I share the same sentiment Phil voiced).  This is exactly the way I would put my +1 :-).  Do we also support things like   
person.getChildren().get(0).getName()?   Martijn   I guess this is: person.children.[0].name and Johan already mentioned it. ./alex --
 .w( the_mindstorm )p.  On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:  I'm very +1 on this. OGNL has turned into it's own scripting language
  over the years. If you want to use any of those features, then you're  missing the point of Wicket.---
  This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today * Register for a JBoss Training Course  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information  ___  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net  https://lists.sourceforge.net/lists/listinfo/wicket-user
 ---  This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005  Visit http://www.jboss.com/services/certification for more information
  ___  Wicket-user mailing list  Wicket-user@lists.sourceforge.net  
https://lists.sourceforge.net/lists/listinfo/wicket-user  --- This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification
 for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user---This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005Visit http://www.jboss.com/services/certification for more information___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



Re: [Wicket-user] replace ognl.

2005-10-27 Thread Juergen Donnerstag
Yes, I agree. Keep it simple. Doesn't Groovy do it the same way, you
proposed it, Johan?

Juergen

On 10/27/05, Alexandru Popescu [EMAIL PROTECTED] wrote:
 #: Johan Compagner changed the world a bit at a time by saying on  10/27/2005 
 10:06 AM :#
  yes i currently don't have support for { or [ or things like that.
  Just plain text with dots. This makes it very easy and fast to parse.
  but if people really want this:
 
  person.children[0].name
 
  does ognl has a special map expression? something like
  person.childeren{child1}.name ?
  i know that it also works for just strings like Ognl.getValue(child1 ,
  myHashMap);
 
  so it all depends on what we really would like to see for array/list:
 
  person.children.0.name http://person.children.0.name
  person.children.[0].name
  person.children[0].name
 
  and maps?
 
  if we want [] in it then i just have to use a bit more logic like a
  tokenizer instead of just doing a plain indexOf loop
 
  I like the simple approache i have now. .
 

 If you start this to keep it simple, than we should keep it that way. IMO 
 person.children.0.name is
 same good as person.children[0].name and as person.children.[0].name, once it 
 is clearly described
 somewhere ;-).

 ./alex
 --
 .w( the_mindstorm )p.

  On 10/27/05, Juergen Donnerstag [EMAIL PROTECTED] wrote:
 
  I'm also +1 on moving OGNL into extension
 
   I guess this is: person.children.[0].name and Johan already mentioned
  it.
 
  I think Johan mentioned, it'll be 
  person.children.0.namehttp://person.children.0.name
 
  Juergen
 
  On 10/27/05, Alexandru Popescu [EMAIL PROTECTED]
  wrote:
   #: Martijn Dashorst changed the world a bit at a time by saying on
  10/27/2005 7:28 AM :#
+1 on moving OGNL into extensions.
   
I think the OGNL thing is good, it provides a nice base
implementation. I'd like to see the current implementation still being
available for those 1% that need the full OGNL expression evaluator
(though I think I share the same sentiment Phil voiced).
   
  
   This is exactly the way I would put my +1 :-).
  
Do we also support things like
   
person.getChildren().get(0).getName()?
   
Martijn
   
   
  
   I guess this is: person.children.[0].name and Johan already mentioned
  it.
  
   ./alex
   --
   .w( the_mindstorm )p.
  
On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
I'm very +1 on this. OGNL has turned into it's own scripting language
over the years. If you want to use any of those features, then you're
missing the point of Wicket.
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of
  2005
Visit http://www.jboss.com/services/certification for more
  information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 2005
   Visit http://www.jboss.com/services/certification for more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 

RE: [Wicket-user] My take on Spring integration

2005-10-27 Thread Joni Suominen
On Wed, 2005-10-26 at 10:59 -0700, Igor Vaynberg wrote:
 This is similar to how i do it. My application is a spring bean that
 gets injected by spring on creation and is then used as a service
 locator. I am simply questioning the automatic injection into pages,
 does it really make sense if it only takes you half way there. If in
 my panel i need to do a ((MyPage)getPage()).getService() then i might
 as well do ((MyApp)getApplication).getService().

I agree that it is very bad if Spring integration using IOC can only be
done as a half baked solution. However, I see following problems when
using Spring as a service locator.

1. Unit testing components

It is not feasible to unit test wicket components wired with full blown
backend services. We often manually wire the dependencies, which is very
easy in IOC paradigm:

public class MyTest extends TestCase {
 public void setUp() {
 MyComponent myComponent = new MyComponent();
 myComponent.setFinder(new MockFinder()); 
 }
}

2. How to abstract the service locator?

Lets say I'm creating a reusable Dictionary component. I'd like to
abstract away the actual interface to dictionary behind
DictionaryLookupService.

public class Dictionary extends Panel {
private transient DictionaryLookupService dictionaryLookupService;

public void onClick() {
 dictionaryLookupService.findWord(...);
 ...
}
}

This implementation, which expects the implementation of
DictionaryLookupService be injected, does not depend on any particular
page, wicket application or spring API.

-- 
Joni Suominen [EMAIL PROTECTED]



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Felix von Delius
I strongly support replacing OGNL with something more performant, as
long as it is not yet another new syntax for accessing properties (we
already have OGNL, Spring property access syntax, some expression
languages from the JSP/Taglib world and probably some others). At
least it sould be OGNL compatible for 90% of the cases. Perhaps using
the Spring implementation is possible? It is widely tested and I
suppose it doesn't have the OGNL performance issues.

Further I remember an issue in this mailinglist that in OGNL adressing
a not existing subtree results in a NullPointerException
(customer.address.city.zip throws NPE if address is null). Maybe a
new implementation could handle this issue without NPE? (There was the
suggestion for a syntax like customer.address?.city.zip, but I'm not
sure it this is a good idea).

Cheers,
Felix


On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
 Hi

  I have written a replacement of OGNL when i test it with a very simple test
 (The FormInput example)
  then i see quite some improvements in cpu speedups and mem improvements

  Around 40% speed increase for a submitting the forminput example page 20
 times
  and only 1/5 of the memory garbage is generated (50MB against 10MB)

  The question is what do you guys use of ognl? Can i completely drop it or
 must i make it an option so
  that you can switch in youre application for all using ognl or the homebrew
 wicket impl.
  Or make seperate classes (like AbstractPropertyModel) but this is not
 really doable because then all the
  sub classes must also be copied...(Like CompoundXX)

  What i do support now is this:

  person.name (plain properties)
  person.addresses.0.street (addresses is a list and i take the first
 element)
  person.addresses.homeaddress.street (addresses is map and i take the
 address with the key 'homeaddress' out of it)

  so maps and list are seen and the next part of the expression is then the
 key or the index you can also put values in a map
  or append/set to a list:

  person.addresses.homeaddress = new Address()
  person.addresses.10 = new Address()

  if the list size is smaller then 10 then it will appends null to make it
 that size.

  addresses can also be an Array but then it won't be able to grow.

  Ofcourse the person.address.street will just be null if address is null, no
 exception will be thrown
  if you try to set something on a null object a exception is still thrown,
 Maybe we could make some null handlers for that somehow that are easy
 useable.

  So can people live with this? Does anybody uses something different of
 ognl?

  johan



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner
That NPE is already handled.
When you do a get a and somewhere in the line a null is encountered then null is returned

With a set a NPE is thrown currently because if that is not handled you loose data (which is bad)
I still am thinking of a way to create the null object then this can be automatic if the object
i have to create has a default constructor and a setMethod is there for that object on its parent.

So that are 2 big ifs... Also thinking about a NullHandler but where does that come from how do we specify that?
For example the parent object could implement an interface called INullHandler with one method createObject(property)
Then the parent object is responsable for making the missing field that it has.
But don't know about this because such an interface is wicket specific
(so ui specific) and the objects are or can be database things
Those worlds should be seperate.

johan


On 10/27/05, Felix von Delius [EMAIL PROTECTED] wrote:
I strongly support replacing OGNL with something more performant, aslong as it is not yet another new syntax for accessing properties (wealready have OGNL, Spring property access syntax, some _expression_languages from the JSP/Taglib world and probably some others). At
least it sould be OGNL compatible for 90% of the cases. Perhaps usingthe Spring implementation is possible? It is widely tested and Isuppose it doesn't have the OGNL performance issues.Further I remember an issue in this mailinglist that in OGNL adressing
a not existing subtree results in a NullPointerException(customer.address.city.zip throws NPE if address is null). Maybe anew implementation could handle this issue without NPE? (There was thesuggestion for a syntax like 
customer.address?.city.zip, but I'm notsure it this is a good idea).Cheers,FelixOn 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
 HiI have written a replacement of OGNL when i test it with a very simple test (The FormInput example)then i see quite some improvements in cpu speedups and mem improvements
Around 40% speed increase for a submitting the forminput example page 20 timesand only 1/5 of the memory garbage is generated (50MB against 10MB)The question is what do you guys use of ognl? Can i completely drop it or
 must i make it an option sothat you can switch in youre application for all using ognl or the homebrew wicket impl.Or make seperate classes (like AbstractPropertyModel) but this is not
 really doable because then all thesub classes must also be copied...(Like CompoundXX)What i do support now is this:person.name (plain properties)
person.addresses.0.street (addresses is a list and i take the first element)person.addresses.homeaddress.street (addresses is map and i take the address with the key 'homeaddress' out of it)
so maps and list are seen and the next part of the _expression_ is then the key or the index you can also put values in a mapor append/set to a list:person.addresses.homeaddress
 = new Address()person.addresses.10 = new Address()if the list size is smaller then 10 then it will appends null to make it that size.addresses can also be an Array but then it won't be able to grow.
Ofcourse the person.address.street will just be null if address is null, no exception will be thrownif you try to set something on a null object a exception is still thrown, Maybe we could make some null handlers for that somehow that are easy
 useable.So can people live with this? Does anybody uses something different of ognl?johan---
This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005Visit 
http://www.jboss.com/services/certification for more information___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Alexandru Popescu

#: Maurice Marrink changed the world a bit at a time by saying on  10/27/2005 
11:16 AM :#

That nullpointer is our problem too and one of the reasons it is being
changed right now.
Don't think johan has put in the syntax you just suggested though.
Afaik it just returns null.



IMO evaluating the expression should stop immediately it reaches a null, but without throwing an 
exception (probably just some smart logging). Take a look at FreeMarker for example and its annoying 
default behavior regarding null handling.


Another solution would be to provide a way to specify a NullPropertyHandler.

./alex
--
.w( the_mindstorm )p.




Maurice Marrink 
www.topicus.nl  

-Original Message-
From: Felix von Delius [mailto:[EMAIL PROTECTED] 
Sent: donderdag 27 oktober 2005 11:10

To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] replace ognl.

I strongly support replacing OGNL with something more performant, as
long as it is not yet another new syntax for accessing properties (we
already have OGNL, Spring property access syntax, some expression
languages from the JSP/Taglib world and probably some others). At
least it sould be OGNL compatible for 90% of the cases. Perhaps using
the Spring implementation is possible? It is widely tested and I
suppose it doesn't have the OGNL performance issues.

Further I remember an issue in this mailinglist that in OGNL adressing
a not existing subtree results in a NullPointerException
(customer.address.city.zip throws NPE if address is null). Maybe a
new implementation could handle this issue without NPE? (There was the
suggestion for a syntax like customer.address?.city.zip, but I'm not
sure it this is a good idea).

Cheers,
Felix


On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:

Hi

 I have written a replacement of OGNL when i test it with a very

simple test

(The FormInput example)
 then i see quite some improvements in cpu speedups and mem

improvements


 Around 40% speed increase for a submitting the forminput example page

20

times
 and only 1/5 of the memory garbage is generated (50MB against 10MB)

 The question is what do you guys use of ognl? Can i completely drop

it or

must i make it an option so
 that you can switch in youre application for all using ognl or the

homebrew

wicket impl.
 Or make seperate classes (like AbstractPropertyModel) but this is not
really doable because then all the
 sub classes must also be copied...(Like CompoundXX)

 What i do support now is this:

 person.name (plain properties)
 person.addresses.0.street (addresses is a list and i take the first
element)
 person.addresses.homeaddress.street (addresses is map and i take the
address with the key 'homeaddress' out of it)

 so maps and list are seen and the next part of the expression is then

the

key or the index you can also put values in a map
 or append/set to a list:

 person.addresses.homeaddress = new Address()
 person.addresses.10 = new Address()

 if the list size is smaller then 10 then it will appends null to make

it

that size.

 addresses can also be an Array but then it won't be able to grow.

 Ofcourse the person.address.street will just be null if address is

null, no

exception will be thrown
 if you try to set something on a null object a exception is still

thrown,

Maybe we could make some null handlers for that somehow that are easy
useable.

 So can people live with this? Does anybody uses something different

of

ognl?

 johan




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner
yes it directly returns null.
i my eyes a nullpropertyhanlder only applies to when you want to set something not when you want to get something.On 10/27/05, Alexandru Popescu 
[EMAIL PROTECTED] wrote:
#: Maurice Marrink changed the world a bit at a time by saying on10/27/2005 11:16 AM :# That nullpointer is our problem too and one of the reasons it is being changed right now. Don't think johan has put in the syntax you just suggested though.
 Afaik it just returns null.IMO evaluating the _expression_ should stop immediately it reaches a null, but without throwing anexception (probably just some smart logging). Take a look at FreeMarker for example and its annoying
default behavior regarding null handling.Another solution would be to provide a way to specify a NullPropertyHandler../alex--.w( the_mindstorm )p. 
 Maurice Marrink www.topicus.nl -Original Message- From: Felix von Delius [mailto:[EMAIL PROTECTED]
] Sent: donderdag 27 oktober 2005 11:10 To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] replace ognl. I strongly support replacing OGNL with something more performant, as
 long as it is not yet another new syntax for accessing properties (we already have OGNL, Spring property access syntax, some _expression_ languages from the JSP/Taglib world and probably some others). At
 least it sould be OGNL compatible for 90% of the cases. Perhaps using the Spring implementation is possible? It is widely tested and I suppose it doesn't have the OGNL performance issues.
 Further I remember an issue in this mailinglist that in OGNL adressing a not existing subtree results in a NullPointerException (customer.address.city.zip throws NPE if address is null). Maybe a
 new implementation could handle this issue without NPE? (There was the suggestion for a syntax like customer.address?.city.zip, but I'm not sure it this is a good idea). Cheers,
 Felix On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote: HiI have written a replacement of OGNL when i test it with a very
 simple test (The FormInput example)then i see quite some improvements in cpu speedups and mem improvementsAround 40% speed increase for a submitting the forminput example page
 20 timesand only 1/5 of the memory garbage is generated (50MB against 10MB)The question is what do you guys use of ognl? Can i completely drop it or
 must i make it an option sothat you can switch in youre application for all using ognl or the homebrew wicket impl.Or make seperate classes (like AbstractPropertyModel) but this is not
 really doable because then all thesub classes must also be copied...(Like CompoundXX)What i do support now is this:
person.name (plain properties)person.addresses.0.street (addresses is a list and i take the first element)person.addresses.homeaddress.street (addresses is map and i take the
 address with the key 'homeaddress' out of it)so maps and list are seen and the next part of the _expression_ is then the key or the index you can also put values in a map
or append/set to a list:person.addresses.homeaddress = new Address()person.addresses.10 = new Address()if the list size is smaller then 10 then it will appends null to make
 it that size.addresses can also be an Array but then it won't be able to grow.Ofcourse the person.address.street will just be null if address is
 null, no exception will be thrownif you try to set something on a null object a exception is still thrown, Maybe we could make some null handlers for that somehow that are easy
 useable.So can people live with this? Does anybody uses something different of ognl?johan ---
 This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit 
http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user ---
 This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit 
http://www.jboss.com/services/certification for more information ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user---
This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005Visit 
http://www.jboss.com/services/certification for more information___Wicket-user mailing listWicket-user@lists.sourceforge.net

Re: [Wicket-user] Re: ListMultipleChoice doesn't call modelChanging()

2005-10-27 Thread Johan Compagner
can you make an bug report for this?
I have to look at it more closely can't do this anymore for 1.1On 10/26/05, Nathan Hamblen [EMAIL PROTECTED]
 wrote:Usually Hibernate works all right for me with copies of Collections, but
maybe it depends on the mapping. It's probably not as fast at dirtychecking either.Anyway, if the bracketing calls to modelChanging / modelChanged areimportant, someone should put them in there. Can they be nested? If not
then the setModelObject call will have to be removed and the newCollection case handled specifically.NathanJohan Compagner wrote: if there was no collection to begin with the setModelObject() wil work.
(Ahh... yes.) It has to act on it directly i don't see another way to do it. And i can't just set a new Collection i think because that could be a hibernate collection that is looking at its contents to do something with it.
 And i don't know exactly what type it is i get. It is a Collection (a List most likely) Now if nothing is returned i just put in a ArrayList (don't know a better solution) I could call modelChanging/modelChanged in that methodright before the
 clear and before the setmodelobject. johan On 10/25/05, *Nathan Hamblen* [EMAIL PROTECTED] mailto:
[EMAIL PROTECTED] wrote: In 1.1 rc2, ListMultipleChoice.updateModel() acts a little funny. It gets a reference to a Collection in line 282, then operates on it directly. First it clears it, then it adds things back.
 At line 316 it calls setModelObject(selectedValues), but that doesn't do anything because the comparator will return that the object is equal to the existing model (it's the same object).
 I'm not sure how important the skipped call to modelChanging is, but it seems weird to be calling setModelObject when nothing will ever happen there as far as I can tell.
 Nathan --- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:
Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
 https://lists.sourceforge.net/lists/listinfo/wicket-user---
This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005Visit 
http://www.jboss.com/services/certification for more information___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How can I get the value of TextField in a table

2005-10-27 Thread Johan Compagner
ahh wait a second
If you click on that link the form which you also should have (you have a TextField that should be in a form)
is course not submitted. You just click on the link not a submit button!
On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
i find youre code a bit strange and not so clean i would do this:

implement getListItemModel of the listView and make a CompoundModel for that listitem

   protected
IModel getListItemModel(final IModel listViewModel, final int index)
   {
  
 return new
CompoundPropertyModel(super.getListItemModel(listViewModel, index));
   }

then in populate item:


 listItem.add(new Label(name));   listItem.add(new Label(description)); listItem.add(new Label(sponser)); listItem.add(new Label(price)); listItem.add

(new Label(id)); listItem.add(new Label(promotion));  listItem.add(new TextField(amount));

 Link buyLink = new Link(buyLink) { public void onClick() {
setResponsePage(new MyCart((ProductList)listItem.getModelObject())); }  public boolean linksTo(Page page) { if (!(page instanceof MyCart))
 return false; 
 return true; } }; listItem.add(buyLink);



On 10/27/05, Alex Chew [EMAIL PROTECTED]
 wrote:
Hay, Guys,  In my application, i use a table
with TextField as Shopping Cart list. but i cannot get the value of the
textfield. Help please. Code fragments followed.
 final ProductList value = (ProductList) listItem.getModelObject(); 
 listItem.add(new Label(name, value.getName()));  listItem.add(new Label(description, value.getDescription()));  listItem.add(new Label(sponser, 
value.getSponser()));  listItem.add(new Label(price, value.getPrice()));  listItem.add(new Label(id, value.getId()));  listItem.add(new Label(promotion, 
value.getPromotion()));  //I want to get the value of the textField ,but i cannot listItem.add(new TextField(amount,new PropertyModel(value,amount)));
 Link buyLink = new Link(buyLink) { public void onClick() {
parameters.setParameter(name, value.getName().toString()); 

parameters.setParameter(description,
value.getDescription().toString()); 
parameters.setParameter(sponser, value.getSponser().toString()); 

parameters.setParameter(price, value.getPrice().toString()); 
parameters.setParameter(id, value.getId().toString());  
parameters.setParameter(promotion, value.getPromotion().toString()); //NullPointerException will be thrown, because value.getAmount() is Null  parameters.setParameter(amount, 
value.getAmount().toString());
 setResponsePage(new MyCart(parameters)); }  public boolean linksTo(Page page) { if (!(page instanceof MyCart)) return false; 
 return true; } }; listItem.add(buyLink);






Re: [Wicket-user] How can I get the value of TextField in a table

2005-10-27 Thread Johan Compagner
i find youre code a bit strange and not so clean i would do this:

implement getListItemModel of the listView and make a CompoundModel for that listitem

   protected
IModel getListItemModel(final IModel listViewModel, final int index)
   {
  
 return new
CompoundPropertyModel(super.getListItemModel(listViewModel, index));
   }

then in populate item:


 listItem.add(new Label(name));   listItem.add(new Label(description)); listItem.add(new Label(sponser)); listItem.add(new Label(price)); listItem.add
(new Label(id)); listItem.add(new Label(promotion));  listItem.add(new TextField(amount));

 Link buyLink = new Link(buyLink) { public void onClick() {
setResponsePage(new MyCart((ProductList)listItem.getModelObject())); }  public boolean linksTo(Page page) { if (!(page instanceof MyCart)) return false; 
 return true; } }; listItem.add(buyLink);



On 10/27/05, Alex Chew [EMAIL PROTECTED] wrote:
Hay, Guys,  In my application, i use a table
with TextField as Shopping Cart list. but i cannot get the value of the
textfield. Help please. Code fragments followed.
 final ProductList value = (ProductList) listItem.getModelObject(); 
 listItem.add(new Label(name, value.getName()));  listItem.add(new Label(description, value.getDescription()));  listItem.add(new Label(sponser, 
value.getSponser()));  listItem.add(new Label(price, value.getPrice()));  listItem.add(new Label(id, value.getId()));  listItem.add(new Label(promotion, 
value.getPromotion()));  //I want to get the value of the textField ,but i cannot listItem.add(new TextField(amount,new PropertyModel(value,amount)));
 Link buyLink = new Link(buyLink) { public void onClick() {
parameters.setParameter(name, value.getName().toString()); 

parameters.setParameter(description,
value.getDescription().toString()); 
parameters.setParameter(sponser, value.getSponser().toString()); 

parameters.setParameter(price, value.getPrice().toString()); 
parameters.setParameter(id, value.getId().toString());  
parameters.setParameter(promotion, value.getPromotion().toString()); //NullPointerException will be thrown, because value.getAmount() is Null  parameters.setParameter(amount, 
value.getAmount().toString());
 setResponsePage(new MyCart(parameters)); }  public boolean linksTo(Page page) { if (!(page instanceof MyCart)) return false; 
 return true; } }; listItem.add(buyLink);




Re: [Wicket-user] SiteMesh and Wicket are compatible?

2005-10-27 Thread Dorel Vaida

Scott T weaver wrote:

Hmm, I don’t think I can agree with that. SiteMesh, AFAIK, can 
aggregate from whole host of markup sources to produce a “finished 
product”. I don’t see how that can be accomplished in the example you 
presented or with Wicket in general, not with out a lot of work that is.


This is the main reason I stopped trying to use Wicket to produce 
portal layouts.


Well, you didn't try hard enough :-). So what happens is that the only 
thing that would be hard to accomplish with Wicket (I'm not the wicket 
expert either) would be to aggregate different sources into the same 
page, like put to the right bar the html source generated by a php 
application etc. For creating portal like interfaces, if you don't 
want to use another markup sources like other php/html etc sites to 
aggregate markup, I think java/markup inheritance in wicket is enough. I 
asked the exact same question when I first heard about wicket but I 
admit now that, except for the case you want to aggregate into your page 
markup generated by other server/context/webapp, there is no need for 
sitemesh. And you have to agree that aggregating different web 
applications (written even in other languages) in a single interface is 
a pretty exotic use case.


I think sitemesh does an excellent job for action oriented java web 
frameworks , but, as a sitemesh user (I still use it in the projects 
where I don't have the luck to be able to choose wicket or tapestry) I 
didn't feel the need of it in wicket applications. To add a portlet 
like component e.g. a login portlet to the left you just add a sign in 
panel to the parent of all the pages that need the signing panel and do 
the same for all.


There could be still possible a limited use of sitemesh, if you would 
want to decorate wicket pages, I think it is possible but with some 
exceptions. You're limited if you want to decorate based on url, except 
the situation when you want to decorate ALL the pages from th wicket 
application, case in which you'll map the decorator to the same url the 
wicket application is mapped, e.g. /wicket-examples*. Decoration based 
on meta tags ( meta decorator=mydecorator placed in each page) should 
also work. With some exceptions I think this should work since sitemesh 
is basically a servlet filter.


I have to say that these are just it may work opinions based on my 
previous Sitemesh and recent Wicket experience, and I didn't actually 
used/implemented anything from the use case above since I really didn't 
need to.


If you fell like you need to use Sitemesh with Wicket and you don't 
use/need anything from outside sources like other web 
applications/sites, I think that you probably have to take a closer look 
at Wicket component approach, markup inheritance, and get rid of 
request/response way of thinking in action frameworks and start to 
think (statefull) OOP and components again :-D.


It is more effort than it is worth to try and get a single 
component/page merge arbitrary markup. The whole “one markup source 
per component” tends to break down very quickly in this type of 
setting and is, IMOHO, a short-coming of most of component-based web 
frameworks that are popping up. That last thing I want to do is 
require my layout and decoration designers to create new component 
classes for each layout they come up with.


Don’t get me wrong; Wicket is wonderful for straight-forward 
application development. However I feel it lacks the flexibility to 
work well as a generalized, light-weight layout engine.


Well, I don't know. I think I could be able to say something in a more 
specific use case. Just maybe :-)



Not everything is a nail ya’ know ;-)

If any of the Wicket gurus out there feel I have misspoken, please let 
me know as I would still love to replace Jetspeed 2’s existing 
layout/decoration mechanism with Wicket.


I'm none of those gurus but ... I think Wicket is best suited for web 
application development. It's not (yet) suited for portlet development 
(I head something a while ago, about some portlet development support in 
wicket but nothing ever since) but even if it would be, I think you 
would write *individual* portlets with it. And they would be still 
layouted by a portal/portlet engine. I don't think Wicket is/will be a 
replacement for a portal. But maybe I'm wrong. I let it to the gurus 
you've mentioned above :-)


Argh ! long reply. too long.


Regards,

Scott T. Weaver



*From:* [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] *On Behalf Of *Andrew 
Berman

*Sent:* Wednesday, October 26, 2005 3:57 PM
*To:* wicket-user@lists.sourceforge.net
*Subject:* Re: [Wicket-user] SiteMesh and Wicket are compatible?

There is no need to use SiteMesh if you are using Wicket. Wicket has 
mechanisms which accomplish the same thing but even better. Take a 
look at Borders, Panels, and markup inheritance 

AW: Re: [Wicket-user] Validation messages

2005-10-27 Thread sven
Looks to me you are right. We didn't think about a Panel being a child
of a Form. I guess it was our assumption that FormComponents are
always a direct child of a Form.

Nested panels inside the same form was the first thing I checked when 
evaluating Wicket. It's a very handy solution to break large forms into logical 
units.

I'm currently not able to look into the code. Do we traverse up the
component tree already, like you do?

Yes, code is taken from the current ComponentStringResourceLoader (sorry,  I 
erroneously referred to DefaultComponentStringResourceLoader). I only 
introduced the variable 'hierarchicalKey'.

Isn't there a risk that due to equal ids, users get messages which
were not meant to be for that component.

Well, Wicket ensures that a path of a component is always unambiguous, so
it works the same way as the name attributes are generated for HTML input 
fields.

With my solution every component developer has full control over its messages 
in its own scope. In the following example each panel doesn't know anything 
about its parents, but each parent is able to override the default message of 
its child:

- Panel1.jave has Textfield 'foo'
- Panel1.properties contains 'foo.RequiredValidator=Foo is required'

- Panel2.java uses Panel1.java as 'panel1'
- Panel2.properties contains 'panel1.foo.RequiredValidator=Foo 1 is required'

- Page3.java uses Panel2.java as 'panel2' in a form 'form'
- Page3.properties contains 'form.panel2.panel1.foo=Regretfully Foo 1 is 
required'

The developer of Page3 is able to override explicitly the message for 'foo' in 
Panel1.java.

Sven


On 10/26/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello,

 I'm struggling with the way Wicket loads String resources, particularly how 
DefaultComponentStringResourceLoader loads validation messages.

 Let's say that we have the following component hierarchy:
 APage
 -BForm id=b
  --XPanel id=x
 RequiredTextField id=foo
  --YPanel id=y
 RequiredTextField id=foo

 XPanel knows nothing about its containing form or page, nevertheless 
XPanel's validation keys must be prefexed with the form's id:

  XPanel.properties:
b.foo.RequiredValidator = Foo is required.

 IMHO this introduces an unwanted dependency of XPanel on its parental form 
(i.e. id=b).

 Furthermore there is no way to override the foo messages separately for 
XPanel and YPanel:

  APage.properties:
b.foo.RequiredValidator = Foo is required in x ??
b.foo.RequiredValidator = Foo is required in y ??

 Now I would prefer, that the validation text for XPanel's foo would be 
searched like in the following:

  APage.properties:
b.x.foo.RequiredValidator = Foo is extremely required.
  XPanel.properties:
foo.RequiredValidator = Foo is required.

 YPanel's validation text could stay unaltered:

  YPanel.properties:
foo.RequiredValidator = Foo is required.

 Fortunately Wicket is pluggable enough to set this straight:
 I've written my own ValidatorResourceKeyFactory, that omits the form's id 
from the key:

  public String newKey(IValidator validator, FormComponent component)
  {
return component.getId() + . + Classes.name(validator.getClass());
  }

 With a custom ComponentStringResourceLoader the key to lookup a message is 
always prefixed with the ids of the parental components:

  // Build search stack
  Stack searchStack = new Stack();
  searchStack.push(component);

  String hierarchicalKey = key;
  if (!(component instanceof Page))
  {
MarkupContainer c = component.getParent();
while (true)
{
  searchStack.push(c);
  if (c instanceof Page)
break;
  hierarchicalKey = c.getId() + . + hierarchicalKey;
  c = c.getParent();
}
  }

  // Iterate through search stack
  String value = null;
  while (!searchStack.isEmpty())
  {
Component c = (Component)searchStack.pop();
Class cc = c.getClass();

while ( value == null ) {
  // Locate previously loaded resources from the cache
  final String id = createCacheId(cc, style, locale);
  ValueMap strings = (ValueMap)resourceCache.get(id);
  if (strings == null)
  {
// No resources previously loaded, attempt to load them
strings = loadResources(c, cc, style, locale, id);
  }

  // Lookup value
  value = strings.getString(hierarchicalKey);
  if (value != null)
break;

  // Move to next superclass
  cc = cc.getSuperclass();
  if (isStopResourceSearch(cc)) break;
}
if (value != null) {
  break;
} else {
  hierarchicalKey = 
hierarchicalKey.substring(hierarchicalKey.indexOf('.') + 1);
}
  }

  // Return the resource value (may be null if resource was not found)
  return value;

 Works great :).

 Now I really wonder who would want to use the 
DefaultComponentStringResourceLoader at all? I don't think that its way of 
loading resources is useful, since it will introduce dependencies and sooner 
or later you'll run into name clashes. IMHO this 

Re: Re: [Wicket-user] Validation messages

2005-10-27 Thread Juergen Donnerstag
Would you please open a bug for it. Thanks.

As long as long as no one else on the list is against fixing it that
way, I'll try and put it into 1.1.

Juergen

On 10/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Looks to me you are right. We didn't think about a Panel being a child
 of a Form. I guess it was our assumption that FormComponents are
 always a direct child of a Form.

 Nested panels inside the same form was the first thing I checked when 
 evaluating Wicket. It's a very handy solution to break large forms into 
 logical units.

 I'm currently not able to look into the code. Do we traverse up the
 component tree already, like you do?

 Yes, code is taken from the current ComponentStringResourceLoader (sorry,  I 
 erroneously referred to DefaultComponentStringResourceLoader). I only 
 introduced the variable 'hierarchicalKey'.

 Isn't there a risk that due to equal ids, users get messages which
 were not meant to be for that component.

 Well, Wicket ensures that a path of a component is always unambiguous, so
 it works the same way as the name attributes are generated for HTML input 
 fields.

 With my solution every component developer has full control over its messages 
 in its own scope. In the following example each panel doesn't know anything 
 about its parents, but each parent is able to override the default message of 
 its child:

 - Panel1.jave has Textfield 'foo'
 - Panel1.properties contains 'foo.RequiredValidator=Foo is required'

 - Panel2.java uses Panel1.java as 'panel1'
 - Panel2.properties contains 'panel1.foo.RequiredValidator=Foo 1 is required'

 - Page3.java uses Panel2.java as 'panel2' in a form 'form'
 - Page3.properties contains 'form.panel2.panel1.foo=Regretfully Foo 1 is 
 required'

 The developer of Page3 is able to override explicitly the message for 'foo' 
 in Panel1.java.

 Sven


 On 10/26/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hello,
 
  I'm struggling with the way Wicket loads String resources, particularly how
 DefaultComponentStringResourceLoader loads validation messages.
 
  Let's say that we have the following component hierarchy:
  APage
  -BForm id=b
   --XPanel id=x
  RequiredTextField id=foo
   --YPanel id=y
  RequiredTextField id=foo
 
  XPanel knows nothing about its containing form or page, nevertheless
 XPanel's validation keys must be prefexed with the form's id:
 
   XPanel.properties:
 b.foo.RequiredValidator = Foo is required.
 
  IMHO this introduces an unwanted dependency of XPanel on its parental form
 (i.e. id=b).
 
  Furthermore there is no way to override the foo messages separately for
 XPanel and YPanel:
 
   APage.properties:
 b.foo.RequiredValidator = Foo is required in x ??
 b.foo.RequiredValidator = Foo is required in y ??
 
  Now I would prefer, that the validation text for XPanel's foo would be
 searched like in the following:
 
   APage.properties:
 b.x.foo.RequiredValidator = Foo is extremely required.
   XPanel.properties:
 foo.RequiredValidator = Foo is required.
 
  YPanel's validation text could stay unaltered:
 
   YPanel.properties:
 foo.RequiredValidator = Foo is required.
 
  Fortunately Wicket is pluggable enough to set this straight:
  I've written my own ValidatorResourceKeyFactory, that omits the form's id
 from the key:
 
   public String newKey(IValidator validator, FormComponent component)
   {
 return component.getId() + . + Classes.name(validator.getClass());
   }
 
  With a custom ComponentStringResourceLoader the key to lookup a message is
 always prefixed with the ids of the parental components:
 
   // Build search stack
   Stack searchStack = new Stack();
   searchStack.push(component);
 
   String hierarchicalKey = key;
   if (!(component instanceof Page))
   {
 MarkupContainer c = component.getParent();
 while (true)
 {
   searchStack.push(c);
   if (c instanceof Page)
 break;
   hierarchicalKey = c.getId() + . + hierarchicalKey;
   c = c.getParent();
 }
   }
 
   // Iterate through search stack
   String value = null;
   while (!searchStack.isEmpty())
   {
 Component c = (Component)searchStack.pop();
 Class cc = c.getClass();
 
 while ( value == null ) {
   // Locate previously loaded resources from the cache
   final String id = createCacheId(cc, style, locale);
   ValueMap strings = (ValueMap)resourceCache.get(id);
   if (strings == null)
   {
 // No resources previously loaded, attempt to load them
 strings = loadResources(c, cc, style, locale, id);
   }
 
   // Lookup value
   value = strings.getString(hierarchicalKey);
   if (value != null)
 break;
 
   // Move to next superclass
   cc = cc.getSuperclass();
   if (isStopResourceSearch(cc)) break;
 }
 if (value != null) {
   break;
 } else {
   hierarchicalKey =
 hierarchicalKey.substring(hierarchicalKey.indexOf('.') + 1);
 }
   }
 
   // Return 

Re: [Wicket-user] SiteMesh and Wicket are compatible?

2005-10-27 Thread Johan Compagner
as far as i know (eelco know better) portlet support will be introduced in 1.2
There is some ground work already for it in 1.1

johanOn 10/27/05, Dorel Vaida [EMAIL PROTECTED] wrote:
Scott T weaver wrote: Hmm, I don't think I can agree with that. SiteMesh, AFAIK, can aggregate from whole host of markup sources to produce a "finished product". I don't see how that can be accomplished in the example you
 presented or with Wicket in general, not with out a lot of work that is. This is the main reason I stopped trying to use Wicket to produce portal layouts.Well, you didn't try hard enough :-). So what happens is that the only
thing that would be hard to accomplish with Wicket (I'm not the wicketexpert either) would be to aggregate different sources into the samepage, like put to the right bar the html source generated by a phpapplication etc. For creating portal like interfaces, if you don't
want to use another markup sources like other php/html etc sites toaggregate markup, I think java/markup inheritance in wicket is enough. Iasked the exact same question when I first heard about wicket but I
admit now that, except for the case you want to aggregate into your pagemarkup generated by other server/context/webapp, there is no need forsitemesh. And you have to agree that aggregating different webapplications (written even in other languages) in a single interface is
a pretty exotic use case.I think sitemesh does an excellent job for action oriented java webframeworks , but, as a sitemesh user (I still use it in the projectswhere I don't have the luck to be able to choose wicket or tapestry) I
didn't feel the need of it in wicket applications. To add a portletlike component e.g. a login portlet to the left you just add a sign inpanel to the parent of all the pages that need the signing panel and do
the same for all.There could be still possible a limited use of sitemesh, if you wouldwant to decorate wicket pages, I think it is possible but with someexceptions. You're limited if you want to decorate based on url, except
the situation when you want to decorate ALL the pages from th wicketapplication, case in which you'll map the decorator to the same url thewicket application is mapped, e.g. /wicket-examples*. Decoration based
on meta tags ( meta decorator=mydecorator placed in each page) shouldalso work. With some exceptions I think this should work since sitemeshis basically a servlet filter.I have to say that these are just it may work opinions based on my
previous Sitemesh and recent Wicket experience, and I didn't actuallyused/implemented anything from the use case above since I really didn'tneed to.If you fell like you need to use Sitemesh with Wicket and you don't
use/need anything from outside sources like other webapplications/sites, I think that you probably have to take a closer lookat Wicket component approach, markup inheritance, and get rid ofrequest/response way of thinking in action frameworks and start to
think (statefull) OOP and components again :-D. It is more effort than it is worth to try and get a single component/page merge arbitrary markup. The whole "one markup source per component" tends to break down very quickly in this type of
 setting and is, IMOHO, a short-coming of most of component-based web frameworks that are popping up. That last thing I want to do is require my layout and decoration designers to create new component
 classes for each layout they come up with. Don't get me wrong; Wicket is wonderful for straight-forward application development. However I feel it lacks the flexibility to work well as a generalized, light-weight layout engine.
Well, I don't know. I think I could be able to say something in a morespecific use case. Just maybe :-) Not everything is a nail ya' know ;-) If any of the Wicket gurus out there feel I have misspoken, please let
 me know as I would still love to replace Jetspeed 2's existing layout/decoration mechanism with Wicket.I'm none of those gurus but ... I think Wicket is best suited for webapplication development. It's not (yet) suited for portlet development
(I head something a while ago, about some portlet development support inwicket but nothing ever since) but even if it would be, I think youwould write *individual* portlets with it. And they would be still
layouted by a portal/portlet engine. I don't think Wicket is/will be areplacement for a portal. But maybe I'm wrong. I let it to the gurusyou've mentioned above :-)Argh ! long reply. too long. Regards,
 Scott T. Weaver  *From:* [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]] *On Behalf Of *Andrew Berman *Sent:* Wednesday, October 26, 2005 3:57 PM *To:* 
wicket-user@lists.sourceforge.net *Subject:* Re: [Wicket-user] SiteMesh and Wicket are compatible? There is no need to use SiteMesh if you are using Wicket. Wicket has
 mechanisms which accomplish the same thing but even better. Take a look at Borders, Panels, and markup 

Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johannes Fahrenkrug

I'm also +1 for replacing ognl.
I'm not trying to say that Wicket is slow, not at all, but any speed 
improvement is .an improvement :)!


- Johannes

Johan Compagner wrote:


Hi

I have written a replacement of OGNL when i test it with a very simple 
test (The FormInput example)

then i see quite some improvements in cpu speedups and mem improvements

Around 40% speed increase for a submitting the forminput example page 
20 times

and only 1/5 of the memory garbage is generated (50MB against 10MB)

The question is what do you guys use of ognl? Can i completely drop it 
or must i make it an option so
that you can switch in youre application for all using ognl or the 
homebrew wicket impl.
Or make seperate classes (like AbstractPropertyModel) but this is not 
really doable because then all the

sub classes must also be copied...(Like CompoundXX)

What i do support now is this:

person.name http://person.name (plain properties)
person.addresses.0.street (addresses is a list and i take the first 
element)
person.addresses.homeaddress.street (addresses is map and i take the 
address with the key 'homeaddress' out of it)


so maps and list are seen and the next part of the expression is then 
the key or the index you can also put values in a map

or append/set to a list:

person.addresses.homeaddress = new Address()
person.addresses.10 = new Address()

if the list size is smaller then 10 then it will appends null to make 
it that size.


addresses can also be an Array but then it won't be able to grow.

Ofcourse the person.address.street will just be null if address is 
null, no exception will be thrown
if you try to set something on a null object a exception is still 
thrown, Maybe we could make some null handlers for that somehow that 
are easy useable.


So can people live with this? Does anybody uses something different of 
ognl?


johan





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Timo Stamm

Johan Compagner wrote:

yes i currently don't have support for { or [ or things like that.
Just plain text with dots. This makes it very easy and fast to parse.
but if people really want this:

person.children[0].name


I can think of two reasons why an access operator [] could be useful:

- It might make the expression more readable, because you know that you 
are operating on an array, List or Map by looking at the expression.


- The content of the access operator could be an expression itself. Example:
person.children[person.selectedChildIndex].name


But I think this is already too much functionality. I would prefer the 
most simple approach with only the most basic support for arrays, Lists 
and Maps using only dot-syntax.



There is one issue that's very important to me. I have run into this 
using the Expression Language of JSP 2.0:


If you have a class that implements Map, you can not access a bean 
property on the instance.


Let's say we have the following class:

class Bar extends HashMap {
public String getFoo() ...
}

Now create an instance and populate it:

Bar b = new Bar();
b.put(yadda, value);


The JSP EL Evaluator would return null for the following expression:

b.foo


I think the Evaluator should look for a value in the map using 
containsKey() and look for a bean property if nothing was found. On a 
list, you could check if the key is numeric.


This would not be a performance hit, and you are still able to use the 
instance like any other object.




Timo


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best way to a handle SSL pages?

2005-10-27 Thread Johan Compagner
i think you just have te redirect to a full url (but then with https)
On 10/26/05, Phil Kulak [EMAIL PROTECTED] wrote:
At first I tried sending a redirect to the URL in the request, butwith https instead of http, but that breaks down if the user isredirected to the secure page since the url may include listenerinterfaces and what have you. I could still do this if there was some
other way to get the url for a page as it currently exists, but I'mnot sure if I can do that, or if it's possible. Does anyone have anyideas on this? My ultimate goal is to just be able to flag pages thatneed to be secure as such, and have all the redirects taken care of in
the super class.---This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: Re: [Wicket-user] Validation messages

2005-10-27 Thread Martijn Dashorst
+1, if it doesn't break stuff.

MartijnOn 10/27/05, Juergen Donnerstag [EMAIL PROTECTED] wrote:
Would you please open a bug for it. Thanks.As long as long as no one else on the list is against fixing it thatway, I'll try and put it into 1.1.JuergenOn 10/27/05, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Looks to me you are right. We didn't think about a Panel being a child of a Form. I guess it was our assumption that FormComponents are
 always a direct child of a Form.
Nested panels inside the same form was the first thing I checked when
evaluating Wicket. It's a very handy solution to break large forms into
logical units. I'm currently not able to look into the code. Do we traverse up the component tree already, like you do?
Yes, code is taken from the current ComponentStringResourceLoader
(sorry,I erroneously referred to
DefaultComponentStringResourceLoader). I only introduced the variable 'hierarchicalKey'. Isn't there a risk that due to equal ids, users get messages which were not meant to be for that component.
 Well, Wicket ensures that a path of a component is always unambiguous, so it works the same way as the name attributes are generated for HTML input fields.
With my solution every component developer has full control over its
messages in its own scope. In the following example each panel doesn't
know anything about its parents, but each parent is able to override
the default message of its child: - Panel1.jave has Textfield 'foo' - Panel1.properties contains 'foo.RequiredValidator=Foo is required' - Panel2.java uses Panel1.java as 'panel1'
 - Panel2.properties contains 'panel1.foo.RequiredValidator=Foo 1 is required' - Page3.java uses Panel2.java as 'panel2' in a form 'form' - Page3.properties contains 'form.panel2.panel1.foo=Regretfully
 Foo 1 is required' The developer of Page3 is able to override explicitly the message for 'foo' in Panel1.java. Sven On 10/26/05, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:  Hello,   I'm struggling with the way Wicket loads String resources, particularly how
 DefaultComponentStringResourceLoader loads validation messages.   Let's say that we have the following component hierarchy:  APage  -BForm id=b
 --XPanel id=x  RequiredTextField id=foo --YPanel id=y  RequiredTextField id=foo
   XPanel knows nothing about its containing form or page, nevertheless XPanel's validation keys must be prefexed with the form's id:  XPanel.properties
: b.foo.RequiredValidator = Foo is required.   IMHO this introduces an unwanted dependency of XPanel on its parental form (i.e. id=b). 
  Furthermore there is no way to override the foo messages separately for XPanel and YPanel:  APage.properties: b.foo.RequiredValidator = Foo is required in x ??
 b.foo.RequiredValidator = Foo is required in y ??   Now I would prefer, that the validation text for XPanel's foo would be searched like in the following:
  APage.properties: b.x.foo.RequiredValidator = Foo is extremely required. XPanel.properties: foo.RequiredValidator = Foo is required.
   YPanel's validation text could stay unaltered:  YPanel.properties: foo.RequiredValidator = Foo is required.   Fortunately Wicket is pluggable enough to set this straight:
  I've written my own ValidatorResourceKeyFactory, that omits the form's id from the key:  public String newKey(IValidator validator, FormComponent component)
 { return component.getId() + . + Classes.name(validator.getClass()); }   With a custom ComponentStringResourceLoader the key to lookup a message is
 always prefixed with the ids of the parental components:  // Build search stack Stack searchStack = new Stack(); searchStack.push(component);
  String hierarchicalKey = key; if (!(component instanceof Page)) { MarkupContainer c = component.getParent(); while (true)
 { searchStack.push(c); if (c instanceof Page) break; hierarchicalKey = c.getId() + . + hierarchicalKey;
 c = c.getParent(); } }  // Iterate through search stack String value = null; while (!searchStack.isEmpty())
 { Component c = (Component)searchStack.pop(); Class cc = c.getClass();  while ( value == null ) { // Locate previously loaded resources from the cache
 final String id = createCacheId(cc, style, locale); ValueMap strings = (ValueMap)resourceCache.get(id); if (strings == null) { // No resources previously loaded, attempt to load them
 strings = loadResources(c, cc, style, locale, id); }  // Lookup value value = strings.getString(hierarchicalKey);
 if (value != null) break;  // Move to next superclass cc = cc.getSuperclass(); if (isStopResourceSearch(cc)) break;
 } if (value != null) { break; } else { hierarchicalKey = hierarchicalKey.substring(hierarchicalKey.indexOf
('.') + 1); } }  // Return the resource value (may be null if resource was not found) return value;   Works great :).
   Now I really wonder who would want to use the DefaultComponentStringResourceLoader at all? I don't think that its way of loading resources is useful, since it will introduce dependencies and sooner
 or later you'll run 

Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner

I can think of two reasons why an access operator [] could be useful:- It might make the _expression_ more readable, because you know that you
are operating on an array, List or Map by looking at the _expression_.- The content of the access operator could be an _expression_ itself. Example:person.children[person.selectedChildIndex].name

If i you want to this then use ognl.
I will not support this by the basic stuff.

If you have a class that implements Map, you can not access a beanproperty on the instance.
Let's say we have the following class:class Bar extends HashMap {public String getFoo() ...}Now create an instance and populate it:Bar b = new Bar();
b.put(yadda, value);The JSP EL Evaluator would return null for the following _expression_:b.fooI think the Evaluator should look for a value in the map using
containsKey() and look for a bean property if nothing was found. On alist, you could check if the key is numeric.

I though about this (List and Maps being beans)
For a list this is not that hard because if the next expresion can be converted to an int then it is just an int for the index.
(get1() is then not supported)
And if it can't be converted then we could check if a method is there.

For maps this is different.
Currently i see List/Maps are not beans. If i always use them as a List or Map.

First check if something is there (in the map) looks strange to me.
Because what happens if you do this:

mymap.value = x

and there is a setValue() but not a map entry?
Should i use setValue or do a map update. (or both?)

I still like the current simple way of notation that i have now. And i
think that we will say: do you want more use the ognl models.

johan




RE: [Wicket-user] SiteMesh and Wicket are compatible?

2005-10-27 Thread Jeff Miller

If I can get the ability to have common decorators (or tiles as inStruts) from Wicket markup inheritance, then I will use wicket only. I do not have to use SiteMesh. I assumed that I would need SiteMesh since I wanted the features of decorators/tiles but did not want to use Struts Tiles. I'll try out Wicket markup inheritance.

Jeff
Igor Vaynberg [EMAIL PROTECTED] wrote:


Andrew is right, wicket has features equivalent to sitemesh. If, however, you need to use it for one reason or another there shouldnt be any problems. Sitemesh is a filter and wicket is a servlet so they shouldnt work together just fine.

-Igor




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew BermanSent: Wednesday, October 26, 2005 12:57 PMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] SiteMesh and Wicket are compatible?
There is no need to use SiteMesh if you are using Wicket. Wicket has mechanisms which accomplish the same thing but even better. Take a look at Borders, Panels, and markup inheritance (http://www.wicket-wiki.org.uk/wiki/index.php/Markup_inheritance)--Andrew
On 10/26/05, Jeff Miller [EMAIL PROTECTED] wrote: 


Has anyoneattempted to useSiteMesh (http://www.opensymphony.com/sitemesh/) with Wicket? If yes, are there any issues or limitations? 

Thanks,
JeffJeff Miller[EMAIL PROTECTED] 


Yahoo! FareChase - Search multiple travel sites in one click. 
Jeff Miller[EMAIL PROTECTED]
		 Yahoo! FareChase - Search multiple travel sites in one click.

 

 

[Wicket-user] Re: replace ognl.

2005-10-27 Thread Nathan Hamblen
I use ognl {} projection to make non-List Collections into Lists for a 
ListView. (And it /is/ way too slow with long lists.) If list view could 
handle a SortedSet, or just any Collection, it would eliminate that need.


It would still be nice to have an OgnlPropertyModel, even if it doesn't 
have an accompanying compound model. Sometimes a complicated expression 
is just what you need, and I'm not crazy about putting those in a 
component ID anyway. But if you're looking to eliminate the ognl jar 
dependency, I guess that's a worthy cause.


Nathan

Johan Compagner wrote:

Hi

I have written a replacement of OGNL when i test it with a very simple 
test (The FormInput example)

then i see quite some improvements in cpu speedups and mem improvements

Around 40% speed increase for a submitting the forminput example page 20 
times

and only 1/5 of the memory garbage is generated (50MB against 10MB)

The question is what do you guys use of ognl? Can i completely drop it 
or must i make it an option so
that you can switch in youre application for all using ognl or the 
homebrew wicket impl.
Or make seperate classes (like AbstractPropertyModel) but this is not 
really doable because then all the

sub classes must also be copied...(Like CompoundXX)

What i do support now is this:

person.name http://person.name (plain properties)
person.addresses.0.street (addresses is a list and i take the first element)
person.addresses.homeaddress.street (addresses is map and i take the 
address with the key 'homeaddress' out of it)


so maps and list are seen and the next part of the expression is then 
the key or the index you can also put values in a map

or append/set to a list:

person.addresses.homeaddress = new Address()
person.addresses.10 = new Address()

if the list size is smaller then 10 then it will appends null to make it 
that size.


addresses can also be an Array but then it won't be able to grow.

Ofcourse the person.address.street will just be null if address is null, 
no exception will be thrown
if you try to set something on a null object a exception is still 
thrown, Maybe we could make some null handlers for that somehow that are 
easy useable.


So can people live with this? Does anybody uses something different of ognl?

johan





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] New Dojo wiper component

2005-10-27 Thread Ruud Booltink

Hi all,

Marco and I just released the first version our new Dojo wiper 
component, the first in our DojoFX series. They can be found in 
contrib.dojo.DojoFX on CVS (FXOnClickWiper.java)


In addition to these components, we've made two tutorials which can be 
found on our weblog


http://jroller.com/comments/ruudmarco/Weblog/simple_wiper_tutorial
http://jroller.com/comments/ruudmarco/Weblog/wiper_menu_tutorial

Marco and Ruud


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Timo Stamm

Johan Compagner wrote:

I can think of two reasons why an access operator [] could be useful:

- It might make the expression more readable, because you know that you
are operating on an array, List or Map by looking at the expression.

- The content of the access operator could be an expression itself.
Example:
person.children[person.selectedChildIndex].name




If i you want to this then use ognl.
I will not support this by the basic stuff.


No, I don't want to do this.

My point is: Brackets can be useful for the two reasons I mentioned. If 
you do not intend to support these features, there is no reason to use 
brackets in the syntax.




I though about this (List and Maps being beans)
For a list this is not that hard because if the next expresion can be
converted to an int then it is just an int for the index.
(get1() is then not supported)
And if it can't be converted then we could check if a method is there.

For maps this is different.
Currently i see List/Maps are not beans. If i always use them as a List or
Map.

First check if something is there (in the map) looks strange to me.


It gives better performance.



Because what happens if you do this:

mymap.value = x

and there is a setValue() but not a map entry?
Should i use setValue or do a map update. (or both?)


That's true, I didn't think of this situation. So it is necessary to 
check for getters/setters before doing map stuff. This would be the 
following accessor precedence:


1 getter/setter
2 List
3 Map


I don't know if the performance hit is too high to allow getter/setter 
access on Maps and Lists, but I would certainly like this feature 
because it is an requirement of a framework I am using.



Anyways, kudos for replacing OGNL with something more simple and efficient.


Timo


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: replace ognl.

2005-10-27 Thread Timo Stamm

Nathan Hamblen wrote:
I use ognl {} projection to make non-List Collections into Lists for a 
ListView. (And it /is/ way too slow with long lists.) If list view could 
handle a SortedSet, or just any Collection, it would eliminate that need.


I created my own List Component in a few minutes that eats Iterable and Map.

The problem is that you can not change the order or get the total size 
for more advanced components from Iterable.



Timo




It would still be nice to have an OgnlPropertyModel, even if it doesn't 
have an accompanying compound model. Sometimes a complicated expression 
is just what you need, and I'm not crazy about putting those in a 
component ID anyway. But if you're looking to eliminate the ognl jar 
dependency, I guess that's a worthy cause.


Nathan

Johan Compagner wrote:


Hi

I have written a replacement of OGNL when i test it with a very simple 
test (The FormInput example)

then i see quite some improvements in cpu speedups and mem improvements

Around 40% speed increase for a submitting the forminput example page 
20 times

and only 1/5 of the memory garbage is generated (50MB against 10MB)

The question is what do you guys use of ognl? Can i completely drop it 
or must i make it an option so
that you can switch in youre application for all using ognl or the 
homebrew wicket impl.
Or make seperate classes (like AbstractPropertyModel) but this is not 
really doable because then all the

sub classes must also be copied...(Like CompoundXX)

What i do support now is this:

person.name http://person.name (plain properties)
person.addresses.0.street (addresses is a list and i take the first 
element)
person.addresses.homeaddress.street (addresses is map and i take the 
address with the key 'homeaddress' out of it)


so maps and list are seen and the next part of the expression is then 
the key or the index you can also put values in a map

or append/set to a list:

person.addresses.homeaddress = new Address()
person.addresses.10 = new Address()

if the list size is smaller then 10 then it will appends null to make 
it that size.


addresses can also be an Array but then it won't be able to grow.

Ofcourse the person.address.street will just be null if address is 
null, no exception will be thrown
if you try to set something on a null object a exception is still 
thrown, Maybe we could make some null handlers for that somehow that 
are easy useable.


So can people live with this? Does anybody uses something different of 
ognl?


johan





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] My take on Spring integration

2005-10-27 Thread Igor Vaynberg
You can set whatever mocks you need in the webapplication class using the
same setters that spring uses. Chances are you are going to need the
webapplication instance present if you are testing wicket anyways as it is a
very central object.

-Igor

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Joni Suominen
 Sent: Thursday, October 27, 2005 2:01 AM
 To: wicket-user@lists.sourceforge.net
 Subject: RE: [Wicket-user] My take on Spring integration
 
 On Wed, 2005-10-26 at 10:59 -0700, Igor Vaynberg wrote:
  This is similar to how i do it. My application is a spring 
 bean that 
  gets injected by spring on creation and is then used as a service 
  locator. I am simply questioning the automatic injection 
 into pages, 
  does it really make sense if it only takes you half way 
 there. If in 
  my panel i need to do a ((MyPage)getPage()).getService() 
 then i might 
  as well do ((MyApp)getApplication).getService().
 
 I agree that it is very bad if Spring integration using IOC 
 can only be done as a half baked solution. However, I see 
 following problems when using Spring as a service locator.
 
 1. Unit testing components
 
 It is not feasible to unit test wicket components wired with 
 full blown backend services. We often manually wire the 
 dependencies, which is very easy in IOC paradigm:
 
 public class MyTest extends TestCase {
  public void setUp() {
  MyComponent myComponent = new MyComponent();
  myComponent.setFinder(new MockFinder()); 
  }
 }
 
 2. How to abstract the service locator?
 
 Lets say I'm creating a reusable Dictionary component. I'd 
 like to abstract away the actual interface to dictionary 
 behind DictionaryLookupService.
 
 public class Dictionary extends Panel {
 private transient DictionaryLookupService dictionaryLookupService;
 
 public void onClick() {
  dictionaryLookupService.findWord(...);
  ...
 }
 }
 
 This implementation, which expects the implementation of 
 DictionaryLookupService be injected, does not depend on any 
 particular page, wicket application or spring API.
 
 --
 Joni Suominen [EMAIL PROTECTED]
 
 
 
 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: replace ognl.

2005-10-27 Thread Eelco Hillenius
I think it would be very practical to both keep such a OGNL property
model /and/ see how we can support both that and our improved property
model in compound property models.

Eelco


On 10/27/05, Nathan Hamblen [EMAIL PROTECTED] wrote:
 I use ognl {} projection to make non-List Collections into Lists for a
 ListView. (And it /is/ way too slow with long lists.) If list view could
 handle a SortedSet, or just any Collection, it would eliminate that need.

 It would still be nice to have an OgnlPropertyModel, even if it doesn't
 have an accompanying compound model. Sometimes a complicated expression
 is just what you need, and I'm not crazy about putting those in a
 component ID anyway. But if you're looking to eliminate the ognl jar
 dependency, I guess that's a worthy cause.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Eelco Hillenius
I'm not too sure about using dots for index/ map references. It
differs from OGNL:
http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html.
And personally, I think it is usefull to be able to distinct single
from indexed properties just by looking at the expression. Is it
/that/ more expensive? I mean, optimizing is good, but we don't have
to over-do it.

Eelco


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] Re: replace ognl.

2005-10-27 Thread Igor Vaynberg
1.1 will have the dataview package in extensions, you can use that to
display sets,etc but you lose paging capability since there really is no
easy way to define an offset within a set unless you are willing to do
something like:
Iterator getItems(int first, int count) {
 Iterator it=getSet().iterator();
for (int i=0;ifirst;i++) { if (!it.hasNext()) { throw error; }
it.next(); }
return it;
}

-Igor


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Nathan Hamblen
 Sent: Thursday, October 27, 2005 7:30 AM
 To: wicket-user@lists.sourceforge.net
 Subject: [Wicket-user] Re: replace ognl.
 
 I use ognl {} projection to make non-List Collections into 
 Lists for a ListView. (And it /is/ way too slow with long 
 lists.) If list view could handle a SortedSet, or just any 
 Collection, it would eliminate that need.
 
 It would still be nice to have an OgnlPropertyModel, even if 
 it doesn't have an accompanying compound model. Sometimes a 
 complicated expression is just what you need, and I'm not 
 crazy about putting those in a component ID anyway. But if 
 you're looking to eliminate the ognl jar dependency, I guess 
 that's a worthy cause.
 
 Nathan
 
 Johan Compagner wrote:
  Hi
  
  I have written a replacement of OGNL when i test it with a 
 very simple 
  test (The FormInput example) then i see quite some 
 improvements in cpu 
  speedups and mem improvements
  
  Around 40% speed increase for a submitting the forminput 
 example page 
  20 times and only 1/5 of the memory garbage is generated 
 (50MB against 
  10MB)
  
  The question is what do you guys use of ognl? Can i 
 completely drop it 
  or must i make it an option so that you can switch in youre 
  application for all using ognl or the homebrew wicket impl.
  Or make seperate classes (like AbstractPropertyModel) but 
 this is not 
  really doable because then all the sub classes must also be 
  copied...(Like CompoundXX)
  
  What i do support now is this:
  
  person.name http://person.name (plain properties) 
  person.addresses.0.street (addresses is a list and i take the first 
  element) person.addresses.homeaddress.street (addresses is 
 map and i 
  take the address with the key 'homeaddress' out of it)
  
  so maps and list are seen and the next part of the 
 expression is then 
  the key or the index you can also put values in a map or 
 append/set to 
  a list:
  
  person.addresses.homeaddress = new Address() 
 person.addresses.10 = new 
  Address()
  
  if the list size is smaller then 10 then it will appends 
 null to make 
  it that size.
  
  addresses can also be an Array but then it won't be able to grow.
  
  Ofcourse the person.address.street will just be null if address is 
  null, no exception will be thrown if you try to set something on a 
  null object a exception is still thrown, Maybe we could 
 make some null 
  handlers for that somehow that are easy useable.
  
  So can people live with this? Does anybody uses something 
 different of ognl?
  
  johan
  
 
 
 
 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course 
 Free Certification Exam for All Training Attendees Through 
 End of 2005 Visit http://www.jboss.com/services/certification 
 for more information ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner
ognl can do map lookup with just a _expression_
(that was the first thing i had to do because that did go wrong when i started testing it)
this was used: Ognl.getValue(string, anHashmap);

so the need to do [sd] even with  juk why is that needed ...?

On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
I'm not too sure about using dots for index/ map references. Itdiffers from OGNL:http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html
.And personally, I think it is usefull to be able to distinct singlefrom indexed properties just by looking at the _expression_. Is it/that/ more expensive? I mean, optimizing is good, but we don't haveto over-do it.
Eelco---This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best way to a handle SSL pages?

2005-10-27 Thread Phil Kulak
Yea, but my problem is finding that full url because when
checkAccess() is called, the url in the request is not the redirect
handler, but whatever interface was called last, and you can't
redirect to that.

On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
 i think you just have te redirect to a full url (but then with https)



 On 10/26/05, Phil Kulak [EMAIL PROTECTED] wrote:
 
  At first I tried sending a redirect to the URL in the request, but
  with https instead of http, but that breaks down if the user is
  redirected to the secure page since the url may include listener
  interfaces and what have you. I could still do this if there was some
  other way to get the url for a page as it currently exists, but I'm
  not sure if I can do that, or if it's possible. Does anyone have any
  ideas on this? My ultimate goal is to just be able to flag pages that
  need to be secure as such, and have all the redirects taken care of in
  the super class.
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for
 more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Eelco Hillenius
If it equals at least one of the OGNL uses, then I'm fine with it.

Eelco

On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
 ognl can do map lookup with just a expression
  (that was the first thing i had to do because that did go wrong when i
 started testing it)
  this was used: Ognl.getValue(string, anHashmap);

  so the need to do [sd]  even with  juk why is that needed ...?




 On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
 
  I'm not too sure about using dots for index/ map references. It
  differs from OGNL:
 
 http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html
 .
  And personally, I think it is usefull to be able to distinct single
  from indexed properties just by looking at the expression. Is it
  /that/ more expensive? I mean, optimizing is good, but we don't have
  to over-do it.
 
  Eelco
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for
 more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Johan Compagner
The only thing for me to use [] for an index and { } for a map (for example)
would be that this:

mymap.property would mean that you really want to have a getProperty on a map
(same goes for list)

so i will change it to use with [] (without quotes that i find totally not needed)

foo.list[0].bar 
foo.map[key].bar
foo.list.bar (this is a get property of the list)
foo.map.bar (this is a get property of the map)

But i am affraid that when i do the last thing (it needs to be a property of map) that wicket fails currently
so i think i fall back to that that i will also look it up as a key if the property is not found.

This will result in more mem en cpu usage.
(i don't create any garbage currently)On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
ognl can do map lookup with just a _expression_
(that was the first thing i had to do because that did go wrong when i started testing it)
this was used: Ognl.getValue(string, anHashmap);

so the need to do [sd] even with  juk why is that needed ...?

On 10/27/05, Eelco Hillenius [EMAIL PROTECTED]
 wrote:
I'm not too sure about using dots for index/ map references. Itdiffers from OGNL:
http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html
.And personally, I think it is usefull to be able to distinct singlefrom indexed properties just by looking at the _expression_. Is it/that/ more expensive? I mean, optimizing is good, but we don't have
to over-do it.
Eelco---This SF.Net email is sponsored by the JBoss Inc.Get Certified Today * Register for a JBoss Training CourseFree Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information___
Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user





Re: [Wicket-user] replace ognl.

2005-10-27 Thread Jonathan Carlson
I'd prefer if it used a groovy-like syntax (or actual groovy behind the
curtain) as much as possible.


 [EMAIL PROTECTED] 2005-10-27 11:15:05 AM 
The only thing for me to use [] for an index and { } for a map (for
example)
would be that this:

mymap.property would mean that you really want to have a getProperty on
a
map
(same goes for list)

so i will change it to use with [] (without quotes that i find totally
not
needed)

foo.list[0].bar
foo.map[key].bar
foo.list.bar (this is a get property of the list)
foo.map.bar (this is a get property of the map)

But i am affraid that when i do the last thing (it needs to be a
property of
map) that wicket fails currently
so i think i fall back to that that i will also look it up as a key if
the
property is not found.

This will result in more mem en cpu usage.
(i don't create any garbage currently)

On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:

 ognl can do map lookup with just a expression
 (that was the first thing i had to do because that did go wrong when
i
 started testing it)
 this was used: Ognl.getValue(string, anHashmap);

 so the need to do [sd] even with  juk why is that needed ...?



 On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
 
  I'm not too sure about using dots for index/ map references. It
  differs from OGNL:
 
http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html

  .
  And personally, I think it is usefull to be able to distinct
single
  from indexed properties just by looking at the expression. Is it
  /that/ more expensive? I mean, optimizing is good, but we don't
have
  to over-do it.
 
  Eelco
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of
2005
  Visit http://www.jboss.com/services/certification for more
information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net 
  https://lists.sourceforge.net/lists/listinfo/wicket-user 
 



__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com 
_


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best way to a handle SSL pages?

2005-10-27 Thread Phil Kulak
I'm trying to get something to work with:

page.urlFor(IRedirectListener.class);

but it just doesn't and I can't seem to figure out why not.

On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
 Yea, but my problem is finding that full url because when
 checkAccess() is called, the url in the request is not the redirect
 handler, but whatever interface was called last, and you can't
 redirect to that.

 On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
  i think you just have te redirect to a full url (but then with https)
 
 
 
  On 10/26/05, Phil Kulak [EMAIL PROTECTED] wrote:
  
   At first I tried sending a redirect to the URL in the request, but
   with https instead of http, but that breaks down if the user is
   redirected to the secure page since the url may include listener
   interfaces and what have you. I could still do this if there was some
   other way to get the url for a page as it currently exists, but I'm
   not sure if I can do that, or if it's possible. Does anyone have any
   ideas on this? My ultimate goal is to just be able to flag pages that
   need to be secure as such, and have all the redirects taken care of in
   the super class.
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 2005
   Visit http://www.jboss.com/services/certification for
  more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Timo Stamm

Johan Compagner wrote:

The only thing for me to use [] for an index and { } for a map (for example)
would be that this:

mymap.property would mean that you really want to have a getProperty on 
a map

(same goes for list)

so i will change it to use with [] (without quotes that i find totally 
not needed)


foo.list[0].bar
foo.map[key].bar
foo.list.bar (this is a get property of the list)
foo.map.bar (this is a get property of the map)


Great. This looks very nice.


Timo


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best way to a handle SSL pages?

2005-10-27 Thread Phil Kulak
Woo hoo! Got it by basically doing what PageMap.redirectToInterceptPage does.

If I made a patch that added a setSecure(boolean) method to WebPage
and handled all this stuff (redirects to https or http accordingly),
would you guys review and consider putting it in the core?

On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
 I'm trying to get something to work with:

 page.urlFor(IRedirectListener.class);

 but it just doesn't and I can't seem to figure out why not.

 On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
  Yea, but my problem is finding that full url because when
  checkAccess() is called, the url in the request is not the redirect
  handler, but whatever interface was called last, and you can't
  redirect to that.
 
  On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
   i think you just have te redirect to a full url (but then with https)
  
  
  
   On 10/26/05, Phil Kulak [EMAIL PROTECTED] wrote:
   
At first I tried sending a redirect to the URL in the request, but
with https instead of http, but that breaks down if the user is
redirected to the secure page since the url may include listener
interfaces and what have you. I could still do this if there was some
other way to get the url for a page as it currently exists, but I'm
not sure if I can do that, or if it's possible. Does anyone have any
ideas on this? My ultimate goal is to just be able to flag pages that
need to be secure as such, and have all the redirects taken care of in
the super class.
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for
   more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
  
 



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Best way to a handle SSL pages?

2005-10-27 Thread Eelco Hillenius
We're comitted to 1.4, so that's fine.

Eelco


On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
 Oh of course, that's what I meant. What Java version do I have to
 write for? I believe that Pattern was introduced in 1.4. Is that too
 late a version?

 On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
  Sounds like a good idea. Would you mind doing it the official way,
  meaning that you put a request up in:
  http://sourceforge.net/tracker/?group_id=119783atid=684977 ? Easier
  to track and put in our changes' history.
 
  Thanks!
 
  Eelco
 
 
  On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
   Woo hoo! Got it by basically doing what PageMap.redirectToInterceptPage 
   does.
  
   If I made a patch that added a setSecure(boolean) method to WebPage
   and handled all this stuff (redirects to https or http accordingly),
   would you guys review and consider putting it in the core?
  
   On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
I'm trying to get something to work with:
   
page.urlFor(IRedirectListener.class);
   
but it just doesn't and I can't seem to figure out why not.
   
On 10/27/05, Phil Kulak [EMAIL PROTECTED] wrote:
 Yea, but my problem is finding that full url because when
 checkAccess() is called, the url in the request is not the redirect
 handler, but whatever interface was called last, and you can't
 redirect to that.

 On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
  i think you just have te redirect to a full url (but then with 
  https)
 
 
 
  On 10/26/05, Phil Kulak [EMAIL PROTECTED] wrote:
  
   At first I tried sending a redirect to the URL in the request, but
   with https instead of http, but that breaks down if the user is
   redirected to the secure page since the url may include listener
   interfaces and what have you. I could still do this if there was 
   some
   other way to get the url for a page as it currently exists, but 
   I'm
   not sure if I can do that, or if it's possible. Does anyone have 
   any
   ideas on this? My ultimate goal is to just be able to flag pages 
   that
   need to be secure as such, and have all the redirects taken care 
   of in
   the super class.
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 
   2005
   Visit http://www.jboss.com/services/certification for
  more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 

   
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 2005
   Visit http://www.jboss.com/services/certification for more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Jonathan Carlson
 and that is?

 Very similar to what you are proposing:
http://groovy.codehaus.org/Collections 

and 

bean?.property  (allows bean to be null)   
(see http://groovy.codehaus.org/Migration+From+Classic+to+JSR+syntax )

I really appreciate how OGNL is very flexible with allowing me to do
things like concatenate two properties into one without having to write
a new getter.  Having a groovy-based property model would give similar
advantages.  And Groovy allows for compact iterating over collections
like OGNL does (although I haven't had a need for it yet).  If you got
rid of that kind of functionality altogether, I think Wicket would be
poorer for it.

My 2 cents worth,

- Jonathan


 [EMAIL PROTECTED] 2005-10-27 1:23:03 PM 
and that is?


On 10/27/05, Jonathan Carlson [EMAIL PROTECTED] wrote:

 I'd prefer if it used a groovy-like syntax (or actual groovy behind
the
 curtain) as much as possible.


  [EMAIL PROTECTED] 2005-10-27 11:15:05 AM 
 The only thing for me to use [] for an index and { } for a map (for
 example)
 would be that this:

 mymap.property would mean that you really want to have a getProperty
on
 a
 map
 (same goes for list)

 so i will change it to use with [] (without quotes that i find
totally
 not
 needed)

 foo.list[0].bar
 foo.map[key].bar
 foo.list.bar (this is a get property of the list)
 foo.map.bar (this is a get property of the map)

 But i am affraid that when i do the last thing (it needs to be a
 property of
 map) that wicket fails currently
 so i think i fall back to that that i will also look it up as a key
if
 the
 property is not found.

 This will result in more mem en cpu usage.
 (i don't create any garbage currently)

 On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
 
  ognl can do map lookup with just a expression
  (that was the first thing i had to do because that did go wrong
when
 i
  started testing it)
  this was used: Ognl.getValue(string, anHashmap);
 
  so the need to do [sd] even with  juk why is that needed ...?
 
 
 
  On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
  
   I'm not too sure about using dots for index/ map references. It
   differs from OGNL:
  

http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html


   .
   And personally, I think it is usefull to be able to distinct
 single
   from indexed properties just by looking at the expression. Is it
   /that/ more expensive? I mean, optimizing is good, but we don't
 have
   to over-do it.
  
   Eelco
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End
of
 2005
   Visit http://www.jboss.com/services/certification for more
 information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net 
   https://lists.sourceforge.net/lists/listinfo/wicket-user 
  
 
 


__
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please
notify
 the system manager.

 Katun Corporation -- www.katun.com http://www.katun.com

_


 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of
2005
 Visit http://www.jboss.com/services/certification for more
information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/wicket-user 


__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com 
_


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] replace ognl.

2005-10-27 Thread Igor Vaynberg
Why not keep wicket simple? I really like the simplicity of the dot notation
johan created. I think we should use [] only as a hint. By default wicket
tries to find a getter and then checks if the object is a list/set/map and
contains the key. The [] hint would tell wicket to skip the getter and go
straight for the contains check. I also like that any null link in the chain
results in a null.

If you really want the complete groovy syntax why not build a groovy
property model using groovy expression evaluator? Same goes for ognl.

My 2 cents.
-Igor

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Jonathan Carlson
 Sent: Thursday, October 27, 2005 11:40 AM
 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] replace ognl.
 
  and that is?
 
  Very similar to what you are proposing:
 http://groovy.codehaus.org/Collections 
 
 and 
 
 bean?.property  (allows bean to be null)   
 (see http://groovy.codehaus.org/Migration+From+Classic+to+JSR+syntax )
 
 I really appreciate how OGNL is very flexible with allowing 
 me to do things like concatenate two properties into one 
 without having to write a new getter.  Having a groovy-based 
 property model would give similar advantages.  And Groovy 
 allows for compact iterating over collections like OGNL does 
 (although I haven't had a need for it yet).  If you got rid 
 of that kind of functionality altogether, I think Wicket 
 would be poorer for it.
 
 My 2 cents worth,
 
 - Jonathan
 
 
  [EMAIL PROTECTED] 2005-10-27 1:23:03 PM 
 and that is?
 
 
 On 10/27/05, Jonathan Carlson [EMAIL PROTECTED] wrote:
 
  I'd prefer if it used a groovy-like syntax (or actual groovy behind
 the
  curtain) as much as possible.
 
 
   [EMAIL PROTECTED] 2005-10-27 11:15:05 AM 
  The only thing for me to use [] for an index and { } for a map (for
  example)
  would be that this:
 
  mymap.property would mean that you really want to have a getProperty
 on
  a
  map
  (same goes for list)
 
  so i will change it to use with [] (without quotes that i find
 totally
  not
  needed)
 
  foo.list[0].bar
  foo.map[key].bar
  foo.list.bar (this is a get property of the list) 
 foo.map.bar (this is 
  a get property of the map)
 
  But i am affraid that when i do the last thing (it needs to be a 
  property of
  map) that wicket fails currently
  so i think i fall back to that that i will also look it up as a key
 if
  the
  property is not found.
 
  This will result in more mem en cpu usage.
  (i don't create any garbage currently)
 
  On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
  
   ognl can do map lookup with just a expression (that was the first 
   thing i had to do because that did go wrong
 when
  i
   started testing it)
   this was used: Ognl.getValue(string, anHashmap);
  
   so the need to do [sd] even with  juk why is that needed ...?
  
  
  
   On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
   
I'm not too sure about using dots for index/ map references. It 
differs from OGNL:
   
 
 http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/ind
 exing.html
 
 
.
And personally, I think it is usefull to be able to distinct
  single
from indexed properties just by looking at the 
 expression. Is it 
/that/ more expensive? I mean, optimizing is good, but we don't
  have
to over-do it.
   
Eelco
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free 
Certification Exam for All Training Attendees Through End
 of
  2005
Visit http://www.jboss.com/services/certification for more
  information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
  
 
 
 __
  This email and any files transmitted with it are confidential and 
  intended solely for the use of the individual or entity to 
 whom they 
  are addressed. If you have received this email in error please
 notify
  the system manager.
 
  Katun Corporation -- www.katun.com http://www.katun.com
 
 _
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course Free 
  Certification Exam for All Training Attendees Through End of
 2005
  Visit http://www.jboss.com/services/certification for more
 information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 __
 This email and any files transmitted with it are 

Re: [Wicket-user] replace ognl.

2005-10-27 Thread Eelco Hillenius
It's all about choice of course. I agree with most proponents of
getting rid of OGNL: it's way too heavy for 95% (or more) of the usual
cases, and less dependencies == good. But, I think it would be really
good not only to keep alternatives in e.g. the extensions project, or
with a seperate project (for the sake of keeping the number of
dependencies needed for extensions small too), but also make sure our
compound property models can work with the different options there are
(you could write a Groovy implementation if you want to, and put it in
the groovy wicket-stuff project).

AbstractPropertyModel could work with something like a
propertyresolver/ delegate (one more indirection :)) for getting and
setting values based on a expression, and it might even be a good idea
to have the option of having the default delegate as a application
setting or something. Would be real easy to implement too.

Eelco


On 10/27/05, Jonathan Carlson [EMAIL PROTECTED] wrote:
  and that is?

  Very similar to what you are proposing:
 http://groovy.codehaus.org/Collections

 and

 bean?.property  (allows bean to be null)
 (see http://groovy.codehaus.org/Migration+From+Classic+to+JSR+syntax )

 I really appreciate how OGNL is very flexible with allowing me to do
 things like concatenate two properties into one without having to write
 a new getter.  Having a groovy-based property model would give similar
 advantages.  And Groovy allows for compact iterating over collections
 like OGNL does (although I haven't had a need for it yet).  If you got
 rid of that kind of functionality altogether, I think Wicket would be
 poorer for it.

 My 2 cents worth,

 - Jonathan


  [EMAIL PROTECTED] 2005-10-27 1:23:03 PM 
 and that is?


 On 10/27/05, Jonathan Carlson [EMAIL PROTECTED] wrote:
 
  I'd prefer if it used a groovy-like syntax (or actual groovy behind
 the
  curtain) as much as possible.
 
 
   [EMAIL PROTECTED] 2005-10-27 11:15:05 AM 
  The only thing for me to use [] for an index and { } for a map (for
  example)
  would be that this:
 
  mymap.property would mean that you really want to have a getProperty
 on
  a
  map
  (same goes for list)
 
  so i will change it to use with [] (without quotes that i find
 totally
  not
  needed)
 
  foo.list[0].bar
  foo.map[key].bar
  foo.list.bar (this is a get property of the list)
  foo.map.bar (this is a get property of the map)
 
  But i am affraid that when i do the last thing (it needs to be a
  property of
  map) that wicket fails currently
  so i think i fall back to that that i will also look it up as a key
 if
  the
  property is not found.
 
  This will result in more mem en cpu usage.
  (i don't create any garbage currently)
 
  On 10/27/05, Johan Compagner [EMAIL PROTECTED] wrote:
  
   ognl can do map lookup with just a expression
   (that was the first thing i had to do because that did go wrong
 when
  i
   started testing it)
   this was used: Ognl.getValue(string, anHashmap);
  
   so the need to do [sd] even with  juk why is that needed ...?
  
  
  
   On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
   
I'm not too sure about using dots for index/ map references. It
differs from OGNL:
   
 
 http://www.ognl.org/2.6.7/Documentation/html/LanguageGuide/indexing.html

 
.
And personally, I think it is usefull to be able to distinct
  single
from indexed properties just by looking at the expression. Is it
/that/ more expensive? I mean, optimizing is good, but we don't
  have
to over-do it.
   
Eelco
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End
 of
  2005
Visit http://www.jboss.com/services/certification for more
  information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
  
 
 
 __
  This email and any files transmitted with it are confidential and
  intended solely for the use of the individual or entity to whom they
  are addressed. If you have received this email in error please
 notify
  the system manager.
 
  Katun Corporation -- www.katun.com http://www.katun.com
 
 _
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of
 2005
  Visit http://www.jboss.com/services/certification for more
 information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 

Re: [Wicket-user] replace ognl.

2005-10-27 Thread Eelco Hillenius
Oh, and of course AbstractPropertyModel.ognlExpression should be
replaced by e.g. .expression or something similar.

Eelco


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: votes needed on SUN/ Java bug

2005-10-27 Thread Eelco Hillenius
Oh, and while your at it, this
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4950148 is another
bug that would be helpful for Wicket to be solved.

Eelco

On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
 Jonathan filed a bug report with SUN that he thinks, when solved, will
 improve some Wicket stuff. Wanna vote? Read it at:
 http://jroller.com/page/JonathanLocke/20051027

 Eelco



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] votes needed on SUN/ Java bug

2005-10-27 Thread Eelco Hillenius
Jonathan filed a bug report with SUN that he thinks, when solved, will
improve some Wicket stuff. Wanna vote? Read it at:
http://jroller.com/page/JonathanLocke/20051027

Eelco


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Sven Meier

Igor Vaynberg wrote:
I am simply questioning the automatic injection into pages, does it really
make sense if it only takes you half way there. If in my panel i need 
to do a

((MyPage)getPage()).getService()
  then i might as well do
((MyApp)getApplication).getService().

IMHO this makes a great difference. In the first case you'll have
PageA
 getService1()
 getService2()
 getService3()
PageB
 getService4()
 getService5()
...

In the latter case you'll have
ApplicationX
 getService1()
 getService2()
 getService3()
 getService4()
 getService5()
 ...

If you'll do this in a large project, your application class will sooner 
or later turn into a sink of services.


BTW rather than letting panels pull service from the page, I'd prefer 
the page to push services into its panels (i.e. the page injects 
dependencies into its panels).

I don't want my panels to be dependent on the containing page.

Just my two cents

Sven


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Stefan Arentz


On Oct 27, 2005, at 12:26 PM, Alexandru Popescu wrote:

#: Joni Suominen changed the world a bit at a time by saying on   
10/27/2005 11:00 AM :#



On Wed, 2005-10-26 at 10:59 -0700, Igor Vaynberg wrote:


This is similar to how i do it. My application is a spring bean that
gets injected by spring on creation and is then used as a service
locator. I am simply questioning the automatic injection into pages,
does it really make sense if it only takes you half way there. If in
my panel i need to do a ((MyPage)getPage()).getService() then i  
might

as well do ((MyApp)getApplication).getService().

I agree that it is very bad if Spring integration using IOC can  
only be

done as a half baked solution. However, I see following problems when
using Spring as a service locator.



I would say that using IoC/DI as a service locator is already a  
half-baked solution.


This is becoming a religious discussion that I am not very interested  
in :-)


 S.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Stefan Arentz


On Oct 27, 2005, at 11:00 AM, Joni Suominen wrote:


On Wed, 2005-10-26 at 10:59 -0700, Igor Vaynberg wrote:


This is similar to how i do it. My application is a spring bean that
gets injected by spring on creation and is then used as a service
locator. I am simply questioning the automatic injection into pages,
does it really make sense if it only takes you half way there. If in
my panel i need to do a ((MyPage)getPage()).getService() then i might
as well do ((MyApp)getApplication).getService().



I agree that it is very bad if Spring integration using IOC can  
only be

done as a half baked solution. However, I see following problems when
using Spring as a service locator.

1. Unit testing components

It is not feasible to unit test wicket components wired with full  
blown
backend services. We often manually wire the dependencies, which is  
very

easy in IOC paradigm:

public class MyTest extends TestCase {
 public void setUp() {
 MyComponent myComponent = new MyComponent();
 myComponent.setFinder(new MockFinder());
 }
}


This is of course no problem. In your test cases, simply don't  
activate the aspect that does the lookup and you will be fine. The  
annotation in the component or web page does nothing by itself.




2. How to abstract the service locator?

Lets say I'm creating a reusable Dictionary component. I'd like to
abstract away the actual interface to dictionary behind
DictionaryLookupService.

public class Dictionary extends Panel {
private transient DictionaryLookupService dictionaryLookupService;

public void onClick() {
 dictionaryLookupService.findWord(...);
 ...
}
}

This implementation, which expects the implementation of
DictionaryLookupService be injected, does not depend on any particular
page, wicket application or spring API.


I don't see the problem here :-)

 S.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Stefan Arentz


On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:


BTW rather than letting panels pull service from the page, I'd  
prefer the page to push services into its panels (i.e. the page  
injects dependencies into its panels).

I don't want my panels to be dependent on the containing page.


Yup. That is exactly what I do.

But. I just moved the aspect from WebPage to Component and guess  
what, the annotation and bean resolving works fine in Panels and  
WebComponents too now :-)


It is still to hackerish to use btw. There are some really nasty  
delays for example. I need to find some time to polish this.


 S.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Laurent PETIT
Hello all,

This is my very first post on this list. Glad to being able to
exchange ideas with you.

On 10/27/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
 Why not keep wicket simple? I really like the simplicity of the dot notation
 johan created. I think we should use [] only as a hint.

 By default wicket tries to find a getter and then checks if the object is a 
 list/set/map and
 contains the key.

Does Wicket also check for direct public property of the same name ?

I mean, this way, we can keep things simple as long as no extra logic
is done in the getter/setter  ( almost 95 to 99% of the time with GUI
Models ? ), but also later on add getters/setters at will, without
breaking anything ...

Same remark concerning maps vs beans.

If find it great if we don't know if the property is contained in the
Map or is a property of the Model.

Thus, a simple Map at the beginning of the project, whose properties
are accessed like
myObjectThatMayBeAMapOrBean.myPropertyName

can later on evolve to a plain JavaBean without breaking all the
String references to the properties :
myObjectThatMayBeAMapOrBean.myPropertyName

I can see that distinguishing maps/beans properties can be a performance hint:
obj[prop]
obj.prop

but for me it's a shame to sacrifice such power.

I can also see that adding [ ] can help identify a map.

In my opinion, obj[prop] and obj.prop should be the same operation
under the covers :
if the object is an instance of a Map:
   first try to interpret prop as a Map key
   second try to access prop via getter/setter
   third try to access prop as a public property of the object
if the object is not an instance of a Map:
first try to access prop via getter/setter
secon try to access prop as a public property of the object

My apologizes if such ideas have already been thrown by somebody.

My 0.02 EUROS :-)

--
Laurent Petit


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Laurent PETIT
Hello,

On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
 AbstractPropertyModel could work with something like a
 propertyresolver/ delegate (one more indirection :)) for getting and
 setting values based on a expression, and it might even be a good idea
 to have the option of having the default delegate as a application
 setting or something. Would be real easy to implement too.

I like the idea of one more indirection :-) to allow more than a
single implementation.

But I can see a problem arise if you do so: having many
implementations that eventually will not share the same syntax for
accessing properties.

This could presumably be a risk for Components Reusability, if some
packaged components embark their own models and rely on a certain
syntax for specifying access to model properties ?


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] replace ognl.

2005-10-27 Thread Eelco Hillenius
Yeah, that's true. You're right. Maybe it isn't such a good idea then.

Eelco


On 10/27/05, Laurent PETIT [EMAIL PROTECTED] wrote:
 Hello,

 On 10/27/05, Eelco Hillenius [EMAIL PROTECTED] wrote:
  AbstractPropertyModel could work with something like a
  propertyresolver/ delegate (one more indirection :)) for getting and
  setting values based on a expression, and it might even be a good idea
  to have the option of having the default delegate as a application
  setting or something. Would be real easy to implement too.

 I like the idea of one more indirection :-) to allow more than a
 single implementation.

 But I can see a problem arise if you do so: having many
 implementations that eventually will not share the same syntax for
 accessing properties.

 This could presumably be a risk for Components Reusability, if some
 packaged components embark their own models and rely on a certain
 syntax for specifying access to model properties ?


 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Christian Essl

Is AOP realy needed for that?

Propably I do not understand the problem but why can't you just write a 
special Panel, Page etc which calls an overrideable injectDependencies() 
method in the constructor. The default implementation of 
injectDependencies() does basicly read the annotations, lookup the 
services and inject them? I think this way you could on an instance by 
instance basis fine-grain control what gets injected. And during testing 
you just inject the mocks in this overriden method.


Just my two cents.

Thanks,
Christian

On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz 
[EMAIL PROTECTED] wrote:




On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:


BTW rather than letting panels pull service from the page, I'd  prefer 
the page to push services into its panels (i.e. the page  injects 
dependencies into its panels).

I don't want my panels to be dependent on the containing page.


Yup. That is exactly what I do.

But. I just moved the aspect from WebPage to Component and guess  what, 
the annotation and bean resolving works fine in Panels and  
WebComponents too now :-)


It is still to hackerish to use btw. There are some really nasty  delays 
for example. I need to find some time to polish this.


  S.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Christian Essl 






___ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] My take on Spring integration

2005-10-27 Thread Igor Vaynberg
You would also need to call injectDependencies when a page and components
are deserialized from session - the latter can be tricky.

-Igor


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Christian Essl
 Sent: Thursday, October 27, 2005 3:55 PM
 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] My take on Spring integration
 
 Is AOP realy needed for that?
 
 Propably I do not understand the problem but why can't you 
 just write a special Panel, Page etc which calls an 
 overrideable injectDependencies() method in the constructor. 
 The default implementation of
 injectDependencies() does basicly read the annotations, 
 lookup the services and inject them? I think this way you 
 could on an instance by instance basis fine-grain control 
 what gets injected. And during testing you just inject the 
 mocks in this overriden method.
 
 Just my two cents.
 
 Thanks,
 Christian
 
 On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz 
 [EMAIL PROTECTED] wrote:
 
 
  On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
 
  BTW rather than letting panels pull service from the page, I'd  
  prefer the page to push services into its panels (i.e. the page  
  injects dependencies into its panels).
  I don't want my panels to be dependent on the containing page.
 
  Yup. That is exactly what I do.
 
  But. I just moved the aspect from WebPage to Component and guess  
  what, the annotation and bean resolving works fine in Panels and 
  WebComponents too now :-)
 
  It is still to hackerish to use btw. There are some really nasty  
  delays for example. I need to find some time to polish this.
 
S.
 
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course Free 
  Certification Exam for All Training Attendees Through End of 2005 
  Visit http://www.jboss.com/services/certification for more 
 information 
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 --
 Christian Essl 
 
   
 
   
   
 ___
 Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - 
 Hier anmelden: http://mail.yahoo.de
 
 
 
 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Alexandru Popescu

#: Christian Essl changed the world a bit at a time by saying on  10/28/2005 
12:54 AM :#

Is AOP realy needed for that?

Propably I do not understand the problem but why can't you just write a 
special Panel, Page etc which calls an overrideable injectDependencies() 
method in the constructor. The default implementation of 
injectDependencies() does basicly read the annotations, lookup the 
services and inject them? 


Because in this case the component itself does the lookup. And this is not what 
you really want.

./alex
--
.w( the_mindstorm )p.

I think this way you could on an instance by
instance basis fine-grain control what gets injected. And during testing 
you just inject the mocks in this overriden method.


Just my two cents.

Thanks,
Christian

On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz 
[EMAIL PROTECTED] wrote:




On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:


BTW rather than letting panels pull service from the page, I'd  prefer 
the page to push services into its panels (i.e. the page  injects 
dependencies into its panels).

I don't want my panels to be dependent on the containing page.


Yup. That is exactly what I do.

But. I just moved the aspect from WebPage to Component and guess  what, 
the annotation and bean resolving works fine in Panels and  
WebComponents too now :-)


It is still to hackerish to use btw. There are some really nasty  delays 
for example. I need to find some time to polish this.


  S.



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user








---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Eelco Hillenius
Furthermore, you should never ever call a overridable method in a constructor.

Eelco

On 10/27/05, Alexandru Popescu [EMAIL PROTECTED] wrote:
 #: Christian Essl changed the world a bit at a time by saying on  10/28/2005 
 12:54 AM :#
  Is AOP realy needed for that?
 
  Propably I do not understand the problem but why can't you just write a
  special Panel, Page etc which calls an overrideable injectDependencies()
  method in the constructor. The default implementation of
  injectDependencies() does basicly read the annotations, lookup the
  services and inject them?

 Because in this case the component itself does the lookup. And this is not 
 what you really want.

 ./alex
 --
 .w( the_mindstorm )p.

 I think this way you could on an instance by
  instance basis fine-grain control what gets injected. And during testing
  you just inject the mocks in this overriden method.
 
  Just my two cents.
 
  Thanks,
  Christian
 
  On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
  [EMAIL PROTECTED] wrote:
 
 
  On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
 
  BTW rather than letting panels pull service from the page, I'd  prefer
  the page to push services into its panels (i.e. the page  injects
  dependencies into its panels).
  I don't want my panels to be dependent on the containing page.
 
  Yup. That is exactly what I do.
 
  But. I just moved the aspect from WebPage to Component and guess  what,
  the annotation and bean resolving works fine in Panels and
  WebComponents too now :-)
 
  It is still to hackerish to use btw. There are some really nasty  delays
  for example. I need to find some time to polish this.
 
S.
 
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Christian Essl
On Thu, 27 Oct 2005 15:56:03 -0700, Igor Vaynberg [EMAIL PROTECTED] 
wrote:



You would also need to call injectDependencies when a page and components
are deserialized from session - the latter can be tricky.



You are right. Maybe construct on deserialization proxies which on first 
call trigger the injectDependencies() and than forward to the actually 
injected service.


Anyway IMO as long as the bean-name is specified in the using class it is 
lookup which you can turn off for testing - and is of course convinient. 
However some key-strokes more can do this as well.


getServiceXY(){
  return _xy == null ? somewhere.getService(xy) : _xy;
}

Christian



-Igor



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Christian Essl
Sent: Thursday, October 27, 2005 3:55 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] My take on Spring integration

Is AOP realy needed for that?

Propably I do not understand the problem but why can't you
just write a special Panel, Page etc which calls an
overrideable injectDependencies() method in the constructor.
The default implementation of
injectDependencies() does basicly read the annotations,
lookup the services and inject them? I think this way you
could on an instance by instance basis fine-grain control
what gets injected. And during testing you just inject the
mocks in this overriden method.

Just my two cents.

Thanks,
Christian

On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
[EMAIL PROTECTED] wrote:


 On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:

 BTW rather than letting panels pull service from the page, I'd
 prefer the page to push services into its panels (i.e. the page
 injects dependencies into its panels).
 I don't want my panels to be dependent on the containing page.

 Yup. That is exactly what I do.

 But. I just moved the aspect from WebPage to Component and guess
 what, the annotation and bean resolving works fine in Panels and
 WebComponents too now :-)

 It is still to hackerish to use btw. There are some really nasty
 delays for example. I need to find some time to polish this.

   S.



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course Free
 Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more
information
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Christian Essl





___
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos -
Hier anmelden: http://mail.yahoo.de



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user








---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Christian Essl 






___ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-10-27 Thread Christian Essl
On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius 
[EMAIL PROTECTED] wrote:


Furthermore, you should never ever call a overridable method in a 
constructor.


You are right. It must be commented to not be dependent on any state set 
of the constructors below this magic helper class. Apart of this 
overriding is generaly a bit dangerous if you don't read the comment well 
and don't know when it is called.


Anyway it was just an idea. I like this 'injection' thing just not AOP.

Christian



Eelco

On 10/27/05, Alexandru Popescu [EMAIL PROTECTED] 
wrote:
#: Christian Essl changed the world a bit at a time by saying on  
10/28/2005 12:54 AM :#

 Is AOP realy needed for that?

 Propably I do not understand the problem but why can't you just write 
a
 special Panel, Page etc which calls an overrideable 
injectDependencies()

 method in the constructor. The default implementation of
 injectDependencies() does basicly read the annotations, lookup the
 services and inject them?

Because in this case the component itself does the lookup. And this is 
not what you really want.


./alex
--
.w( the_mindstorm )p.

I think this way you could on an instance by
 instance basis fine-grain control what gets injected. And during 
testing

 you just inject the mocks in this overriden method.

 Just my two cents.

 Thanks,
 Christian

 On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
 [EMAIL PROTECTED] wrote:


 On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:

 BTW rather than letting panels pull service from the page, I'd  
prefer

 the page to push services into its panels (i.e. the page  injects
 dependencies into its panels).
 I don't want my panels to be dependent on the containing page.

 Yup. That is exactly what I do.

 But. I just moved the aspect from WebPage to Component and guess  
what,

 the annotation and bean resolving works fine in Panels and
 WebComponents too now :-)

 It is still to hackerish to use btw. There are some really nasty  
delays

 for example. I need to find some time to polish this.

   S.



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 
2005
 Visit http://www.jboss.com/services/certification for more 
information

 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user






---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




--
Christian Essl 






___ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user