Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread RUMikeP

Why would you want to delete those jars?  I am busy using them and the appear
to be working fine (for what I am using).  Please can you explain what is
broken/why it would be better to use 1.3-SNAPSHOT?  What do I lose by
reverting back to 1.3-SNAPSHOT?  What is the latest version of Wicket that I
can use with SWARM 1.3-SNAPSHOT?

Thanks
Mike



Mr Mean wrote:
 
 ...
 
 Argh, i am only just reading you are using 1.3.1-SNAPSHOT. You should
 be using 1.3-SNAPSHOT. That does it i am deleting those jars.
 
 Maurice
 
 

-- 
View this message in context: 
http://www.nabble.com/Swarm%3A-Authorization--for-WebMarkupContainer-tp17206272p17223972.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
I dont care, because i cant do any thing with the ? The only thing it
enforces is that it must now be a generic class which is annoying. Not
to mention that in that area eclipse and javac accept different
things

So or we in wicket dont use ? any where and have supress warning
everywhere for that or we do use it and then suddenly it is in my eyes
restricted to much.

On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Johan Compagner wrote:
  yes thats the reason
 
  you are calling the method add with a generified component but that
  container itself is not generified
 
  i dont like this about generics expecially the onces like this:
 
  add(MarkupContainer? container)
 
  then suddenly a none generified component cant be added...
  thats really stupid ? should mean anything.. including none generics

 No, that's not correct. For example, List? is much more restrictive
 than a raw List (which is a ListObject). To a raw list you can add an
 instance of any type whatever, i.e., list.add(new Object()). But in
 List? the ? is a wildcard which says it could be any type there, i.e.,
 it could be a ListInteger. But you can't add a new Object() to a
 ListInteger!

 Thus MarkupContainer? means MarkupContainer parameterized by some
 unknown type, and *not* MarkupContainer parameterized by Object, which
 is what the raw type means.

 Regards,
 Sebastiaan

  johan
 
 
  On Tue, May 13, 2008 at 5:55 PM, Stefan Simik [EMAIL PROTECTED]
  wrote:
 
  I have one idea,
 
  the reason of the warnigs is, that parent of AjaxPagingNavigator is
  PagingNavigator,
  which has parent Panel --- that is not parameterized.
 
  The same problem is with LoopItem, which extends the
  WebMarkupContainer --- that is not parameterized.
 
  ? could this be the reason ?
 
 
 
 
 
 
  Stefan Simik wrote:
  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I add a simple
  ListView
  ---
  ListViewInteger menu = new ListViewInteger(id, numbers){
  //populate metods
  }
  add(menu);//warning here
 
  The warning says:
  Type safety: The method add(Component...) belongs to the raw type
  MarkupContainer.
  References to generic type MarkupContainerT should be parameterized
 
  I cannot find out, what's the warning reason, because ListView self is
  parameterized.
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread Maurice Marrink
1.3.1-SNAPSHOT is an older version it has been renamed to follow
wicket naming conventions to 1.3-SNAPSHOT.
That is the major and minor versions will always be used to indicate
the latest snapshot, this prevents users needing to change there pom
whenever a new patch version has been released.

I originally kept the old jars because someone might still depend on
them, like you do. but lately it has become clear to me that they are
causing a lot of confusion so i removed them last night.
The 1.3.1-SNAPSHOT was actually a lot closer to the 1.3.0 jar then the
current 1.3-SNAPSHOT is. So you would not be reverting back but
actually take advantage of the latest changes :)

For a list of changes see
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Security+1.3.1#Wicket-Security1.3.1-migrateto1.3.1

Maurice


On Wed, May 14, 2008 at 8:04 AM, RUMikeP [EMAIL PROTECTED] wrote:

  Why would you want to delete those jars?  I am busy using them and the appear
  to be working fine (for what I am using).  Please can you explain what is
  broken/why it would be better to use 1.3-SNAPSHOT?  What do I lose by
  reverting back to 1.3-SNAPSHOT?  What is the latest version of Wicket that I
  can use with SWARM 1.3-SNAPSHOT?

  Thanks
  Mike



  Mr Mean wrote:
  
   ...

 
   Argh, i am only just reading you are using 1.3.1-SNAPSHOT. You should
   be using 1.3-SNAPSHOT. That does it i am deleting those jars.
  
   Maurice
  
  

  --
  View this message in context: 
 http://www.nabble.com/Swarm%3A-Authorization--for-WebMarkupContainer-tp17206272p17223972.html
  Sent from the Wicket - User mailing list archive at Nabble.com.




  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
I dont think that user gets a warning if a param is of raw type. But
we have a warning there.
The problem is that for example MarkupContainer.add(Component) or
IVisitor.visit(Component) i dont care what component is put in
generified or not.
In add it really doesnt matter because we dont do anything with it.
With visitor it is different because the user could use it inside the
method. But it should be useable without warnings for generified and
none generfied components..


On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 if we have a signature that accepts a raw type, will that also cause a
 warning in user's code?

 also having those suppress annotations practically _everywhere_ will be
 annoying

 -igor


 On Tue, May 13, 2008 at 11:56 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  I dont care, because i cant do any thing with the ? The only thing it
   enforces is that it must now be a generic class which is annoying. Not
   to mention that in that area eclipse and javac accept different
   things
 
   So or we in wicket dont use ? any where and have supress warning
   everywhere for that or we do use it and then suddenly it is in my eyes
   restricted to much.
 
 
 
   On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
Johan Compagner wrote:
 yes thats the reason

 you are calling the method add with a generified component but that
 container itself is not generified

 i dont like this about generics expecially the onces like this:

 add(MarkupContainer? container)

 then suddenly a none generified component cant be added...
 thats really stupid ? should mean anything.. including none
 generics
   
No, that's not correct. For example, List? is much more restrictive
than a raw List (which is a ListObject). To a raw list you can add an
instance of any type whatever, i.e., list.add(new Object()). But in
List? the ? is a wildcard which says it could be any type there,
 i.e.,
it could be a ListInteger. But you can't add a new Object() to a
ListInteger!
   
Thus MarkupContainer? means MarkupContainer parameterized by some
unknown type, and *not* MarkupContainer parameterized by Object, which
is what the raw type means.
   
Regards,
Sebastiaan
   
 johan


 On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
 [EMAIL PROTECTED]
 wrote:

 I have one idea,

 the reason of the warnigs is, that parent of AjaxPagingNavigator is
 PagingNavigator,
 which has parent Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:
 Mhmm, it is meaningful ;) I will know in future, thx

 One of the last occuring warning is, when working with
 MarkupContainer#add(...)  or  #addOrReplace(...)  method.

 Example:  I have a simple AjaxPagingNavigator, to which I add a
 simple
 ListView

 ---
 ListViewInteger menu = new ListViewInteger(id, numbers){
 //populate metods
 }
 add(menu);//warning here

 The warning says:
 Type safety: The method add(Component...) belongs to the raw type
 MarkupContainer.
 References to generic type MarkupContainerT should be
 parameterized

 I cannot find out, what's the warning reason, because ListView self
 is
 parameterized.


 --
 View this message in context:

   
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
 Sent from the Wicket - User mailing list archive at Nabble.com.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



   
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk
My post kind of missed the point, I shouldn't post when I'm already half 
asleep. :-)


Obviously MarkupContainerObject satisfies the MarkupContainer? in a 
method argument, so it accepts the raw type. However, it generates a 
warning because the method says it's generified, so you should be using 
the generic type.


Johan Compagner wrote:

I dont care, because i cant do any thing with the ? The only thing it
enforces is that it must now be a generic class which is annoying. Not
to mention that in that area eclipse and javac accept different
things


The reason it warns you to use generics when generics are wanted is 
because Sun wants to be able to make it *required* (in a future release) 
to use generics where generics are wanted; at least, so I read... I 
think in the real world they wouldn't dare to do this because it would 
piss off so many users and break so much stuff. :-)


But the idea is that if something is generified you should be using a 
type parameter, and using a raw type is *purely* for backwards 
compatibility with legacy code.


Regards,
Sebastiaan


So or we in wicket dont use ? any where and have supress warning
everywhere for that or we do use it and then suddenly it is in my eyes
restricted to much.


I don't understand


On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

Johan Compagner wrote:

yes thats the reason

you are calling the method add with a generified component but that
container itself is not generified

i dont like this about generics expecially the onces like this:

add(MarkupContainer? container)

then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none generics

No, that's not correct. For example, List? is much more restrictive
than a raw List (which is a ListObject). To a raw list you can add an
instance of any type whatever, i.e., list.add(new Object()). But in
List? the ? is a wildcard which says it could be any type there, i.e.,
it could be a ListInteger. But you can't add a new Object() to a
ListInteger!

Thus MarkupContainer? means MarkupContainer parameterized by some
unknown type, and *not* MarkupContainer parameterized by Object, which
is what the raw type means.

Regards,
Sebastiaan


johan


On Tue, May 13, 2008 at 5:55 PM, Stefan Simik [EMAIL PROTECTED]
wrote:


I have one idea,

the reason of the warnigs is, that parent of AjaxPagingNavigator is
PagingNavigator,
which has parent Panel --- that is not parameterized.

The same problem is with LoopItem, which extends the
WebMarkupContainer --- that is not parameterized.

? could this be the reason ?






Stefan Simik wrote:

Mhmm, it is meaningful ;) I will know in future, thx

One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.

Example:  I have a simple AjaxPagingNavigator, to which I add a simple
ListView
---
ListViewInteger menu = new ListViewInteger(id, numbers){
//populate metods
}
add(menu);//warning here

The warning says:
Type safety: The method add(Component...) belongs to the raw type
MarkupContainer.
References to generic type MarkupContainerT should be parameterized

I cannot find out, what's the warning reason, because ListView self is
parameterized.



--
View this message in context:


http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html

Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
The problem is that wicket needs an annotation

genericsOptional

so that all the warnings about raw types are gone.

A component only has to be generic if you use the IModel constructor or call
getModel(), getModelObject() methods..
for the rest it is not really needed

johan

On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk [EMAIL PROTECTED]
wrote:

 My post kind of missed the point, I shouldn't post when I'm already half
 asleep. :-)

 Obviously MarkupContainerObject satisfies the MarkupContainer? in a
 method argument, so it accepts the raw type. However, it generates a warning
 because the method says it's generified, so you should be using the generic
 type.

 Johan Compagner wrote:

  I dont care, because i cant do any thing with the ? The only thing it
  enforces is that it must now be a generic class which is annoying. Not
  to mention that in that area eclipse and javac accept different
  things
 

 The reason it warns you to use generics when generics are wanted is
 because Sun wants to be able to make it *required* (in a future release) to
 use generics where generics are wanted; at least, so I read... I think in
 the real world they wouldn't dare to do this because it would piss off so
 many users and break so much stuff. :-)

 But the idea is that if something is generified you should be using a type
 parameter, and using a raw type is *purely* for backwards compatibility with
 legacy code.

 Regards,
 Sebastiaan

  So or we in wicket dont use ? any where and have supress warning
  everywhere for that or we do use it and then suddenly it is in my eyes
  restricted to much.
 

 I don't understand


  On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 
   Johan Compagner wrote:
  
yes thats the reason
   
you are calling the method add with a generified component but that
container itself is not generified
   
i dont like this about generics expecially the onces like this:
   
add(MarkupContainer? container)
   
then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none
generics
   
   No, that's not correct. For example, List? is much more restrictive
   than a raw List (which is a ListObject). To a raw list you can add
   an
   instance of any type whatever, i.e., list.add(new Object()). But in
   List? the ? is a wildcard which says it could be any type there,
   i.e.,
   it could be a ListInteger. But you can't add a new Object() to a
   ListInteger!
  
   Thus MarkupContainer? means MarkupContainer parameterized by some
   unknown type, and *not* MarkupContainer parameterized by Object,
   which
   is what the raw type means.
  
   Regards,
   Sebastiaan
  
johan
   
   
On Tue, May 13, 2008 at 5:55 PM, Stefan Simik 
[EMAIL PROTECTED]
wrote:
   
 I have one idea,

 the reason of the warnigs is, that parent of AjaxPagingNavigator
 is
 PagingNavigator,
 which has parent Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:

  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
  ListView
 
  ---
  ListViewInteger menu = new ListViewInteger(id, numbers){
 //populate metods
  }
  add(menu);//warning here
 
  The warning says:
  Type safety: The method add(Component...) belongs to the raw
  type
  MarkupContainer.
  References to generic type MarkupContainerT should be
  parameterized
 
  I cannot find out, what's the warning reason, because ListView
  self is
  parameterized.
 
 
   --
 View this message in context:


   http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
  
Sent from the Wicket - User mailing list archive at Nabble.com.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


Re: persistent sessions in Tomcat

2008-05-14 Thread ElSe


Thanks, I tried to check this for wicket examples and it works with default
server configuration. This means that there are some error in my
application... but I haven't any error messages... ok, I'll continue
experiments.
Does that message page expired mean that the session is gone? So I have
next question: default session timeout for Tomcat is 30 minutes but page
expired appears much earlier - even for wicket examples. Why?

Johan Compagner wrote:
 
 the default config of tomcat already restarts the wicket example sessions
 just fine for me
 I havent changed 1 thing about that
 
 
 On Tue, May 13, 2008 at 11:59 AM, ElSe [EMAIL PROTECTED] wrote:
 

 Do you mean tomcat logs? No I don't. Some *.ser files appear  in the
 work\Catalina\localhost\application directory so session is serialized
 but
 isn't restored.

 Do I understand correctly that my assumption is correct and the wicket
 session must be restored with the tomcat persistent manager? So there
 must
 be some error in the configuration of the server or application itself?


 igor.vaynberg wrote:
 
  do you get any serialization errors in your logs, you might be trying
  to store something non serializable in the wicket component.
 
  -igor
 
 
  On Mon, May 12, 2008 at 1:09 AM, ElSe [EMAIL PROTECTED] wrote:
 
   Hi,
 
   I'm just started experiments with Wicket so I suppose my question is
  stupid
   however I haven't found the answer on the forum.
 
   The point was to understand how to organize persistent sessions for
 the
   wicket application. It seemed to me that such application should work
  with
   the standard Tomcat mechanism transparently as any other servlet.
   So I have written simple wicket application - just two pages that
 show
   sessionid, configured Tomcat persistent manager and  started session.
  Then I
   restarted the server and tried to pass from one page to another
 waiting
  to
   see  the same sessionid. But I have seen page has expired.
   Should I provide some serialization support in my application or
 there
  is
   some error in my logic or there aren't such possibility and I want
   something strange(c)?
 
   BR
   --
   View this message in context:
 
 http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17183181.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17205069.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17226017.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket Portlets in Liferay 5

2008-05-14 Thread Benjamin Ernst
Hi Thijs,

We are currently trying to integrate Liferay 5 with wicket 1.3. Can you give
us the advise you offered? That would be very nice.

Thank you in advance,
Benjamin

On Mon, May 5, 2008 at 11:33 PM, Thijs Vonk [EMAIL PROTECTED] wrote:

 Hi,

 Currently without building wicket against Liferay (using
 com.liferay.portlet.renderresponseimpl, instead of
 javax.portlet.renderresponse) it is not possible to run wicket without
 losing most of wickets functionality.
 I can, if you want, give you a patch and some instructions to get wicket
 working on liferay 5, but we are still modifying wicket and Liferay code to
 get things working as we want it. So I can't guaranty anything.

 Thijs


 Bobby Quninne wrote:

  Hi there, I am currently considering using wicket 1.3.3(and newer) with
  liferay 5. The site is going to be used for backend administration,
  standard CRUD
  stuff. How big a risk is it, using wicket portal and liferay?
  Thanks
 
 
  Thijs wrote:
 
 
   Hi,
  
   I'm working on getting wicket compatible with jsr-286 now. However
   while doing this I've noticed that Liferay has still some major issues
   regarding jsr-286. Especially regarding setting properties on the response
   (essentially setting response headers, cookies, etc)  there is still some
   work to be done. They also don't support the MARKUP_HEAD_ELEMENT_SUPPORT
   feaure jet, what would be a really nice addition because of the CSS and JS
   files wicket adds to it's pages.
   Comment and vote on http://support.liferay.com/browse/LEP-5828. and
   track it to follow the property changes
  
I'm also planning on opening a Wicket-jira issue so that you can
   track the progress of the wicket implementation. But we will have to wait 
   at
   least until the portlet 2.0 specifications get official and added to a 
   maven
   repository before we can add anything to the wicket code base. Besides 
   that
   it's a lot of work and I'm doing this in my free hours so don't get over
   excited just jet :).
  
   I'll post a message on the list when I open the jira issue, and I'll
   attach patches to that issue as soon as I feel confident about the work 
   I've
   been doing.
  
   I hope that answers your questions a bit.
   Thijs
  
  
   gaugat wrote:
  
  
I've read in the forums, that it is better to wait for Liferay 5
(JSR
286) to
develop portlets in Apache Wicket. So has anyone developed portlets
using
Wicket and deployed them in Liferay 5?. If you have, is there a
sample
wicket portlet posted somewhere that I could look at? Are there
still
issues
with Wicket and Liferay?
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Quan Zhou
Hello everyone.

I override Localizer.putIntoCache method. and it really reduce the heapsize
usage of Localizer.

The application is more stable now although the key remains large.

Hope we can find a way to shorter the key length.

thanks everyone.

2008/5/13 Eirik Rude [EMAIL PROTECTED]:


 A soft reference is very common for this type of thing.  I know some of
 ICU's
 resources are stored this way.



 Jonathan Locke wrote:
 
 
  maybe localizer should limit its size or use a soft reference cache?
 
 
  Johan Compagner wrote:
 
  Can you really see what it holds?
  Almost 2G in memory in localizer is extreme... Thats really a lot of
  strings..
  You could try to read that dump with yourkit if your current one
  doesnt show enough.
 
  On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
  Hello everyone.
 
  I recently develop my App use Wicket1.3.3. It's my first time to use
  this
  framework and I feel it's really really a perfect framework for me.
  My app support both Simplified Chinese , Traditional Chinese, I
  implement
  this with Wicket i18n feature.
  With the load increasing these days, I found my app would become very
  lag
  abount every 24 hours ,so that i would only restart it
  without any choice.
  when I found the lag, My log records many Exceptions like :
  after 1 minute the Pagemap null is still locked by:
  Thread[http-8080-321,5,main], giving
  up trying to get the page for path xxx
 
  I check the JVM status with jstat -gc , It tells that the Heapsize is
  full
  even after full GC.
  My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
  -XX:MaxPermSize=250m
  My deploy server has 2*CPU and 4G memory, Redhat AS4 OS + tomcat 6.0.
  There're 2000 sessions on the day while the timeout threshold is 15
  minutes.
  So i dump the whole heapsize with the command  jmap
  -dump:live,format=b,file=3.dump.hprof processid
  and i truely get a 2G size dump files. I use SAP Memory Analyer to see
  what're stored in HeapMemory.
  and I found a strange number of Retained Heap usage:
  Classname
   ShallowHeap   RetainHeap
RetainedHeap%
  [EMAIL PROTECTED]
  16
  1,755,070,35287.64%
   [EMAIL PROTECTED]
  48 1,755,070,33687.69%
[EMAIL PROTECTED]
   33,554,448
   1,755,069,632   87.69%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -  [EMAIL PROTECTED]
 ...
 24   3928
  0.00%
+ 2,863,659 more...
 
  Is that means that the Localizer Object used most of the heap size?
  or Is this number normal for Wicket App?
 
  I wonder whether I forget to release the memory by my mis-using of
 i18n
  feature?
  Is there any attentions I must pay to when dealing with Localizer?
 
  This problem annoys me more the 2 weeks. I really need some help.
 Thanks
  .
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Why-Localizer-Retained-so-many-heapsize--tp17142582p17199950.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: FYI: new wicket site

2008-05-14 Thread Gerolf Seitz
the site looks nice.
i especially like the advanced dropdown box.

for us non-dutch, does eropuit mean anything in particular?

cheers,
  Gerolf

On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:

 Hi all,

 A new Wicket site is born! It's a Dutch site on which you can search for
 day
 trips and such. See: www.eropuit.nl.

 Thanks to the user- and dev-group for answering any questions we had
 during
 the process.

 Lars



Re: FYI: new wicket site

2008-05-14 Thread Maurice Marrink
nice :)

one thing though: i went searching for uitjes and after clicking the
volgende button a couple of times i selected one to show more details.
Now when i use the browser backbutton or the terug link i always end
up at the first page of my search results. I would have expected to
return to the page i came from. Also if i then click volgende i remain
on the first page, clicking volgende again takes me to the 2nd page.

@Gerolf er op uit could be loosely translated as going places or
taking a trip.

Maurice

On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
 Hi all,

  A new Wicket site is born! It's a Dutch site on which you can search for day
  trips and such. See: www.eropuit.nl.

  Thanks to the user- and dev-group for answering any questions we had during
  the process.

  Lars


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread Erik van Oosten
It is a combination of 3 words 'er op uit' and literally means 'going 
out'. It has a very active connotation.


Regards,
   Erik.

Gerolf Seitz wrote:

the site looks nice.
i especially like the advanced dropdown box.

for us non-dutch, does eropuit mean anything in particular?

cheers,
  Gerolf

On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:

  

Hi all,

A new Wicket site is born! It's a Dutch site on which you can search for
day
trips and such. See: www.eropuit.nl.

Thanks to the user- and dev-group for answering any questions we had
during
the process.

Lars




  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FYI: new wicket site

2008-05-14 Thread lars vonk
Hi all,

A new Wicket site is born! It's a Dutch site on which you can search for day
trips and such. See: www.eropuit.nl.

Thanks to the user- and dev-group for answering any questions we had during
the process.

Lars


Re: FYI: new wicket site

2008-05-14 Thread Gerolf Seitz
On Wed, May 14, 2008 at 10:52 AM, Maurice Marrink [EMAIL PROTECTED] wrote:

 @Gerolf er op uit could be loosely translated as going places or
 taking a trip.


thx :)



 Maurice

 On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
  Hi all,
 
   A new Wicket site is born! It's a Dutch site on which you can search
 for day
   trips and such. See: www.eropuit.nl.
 
   Thanks to the user- and dev-group for answering any questions we had
 during
   the process.
 
   Lars
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: FYI: new wicket site

2008-05-14 Thread lars vonk
Thanks for spotting that. We'll look into it.

Lars

On Wed, May 14, 2008 at 10:52 AM, Maurice Marrink [EMAIL PROTECTED] wrote:

 nice :)

 one thing though: i went searching for uitjes and after clicking the
 volgende button a couple of times i selected one to show more details.
 Now when i use the browser backbutton or the terug link i always end
 up at the first page of my search results. I would have expected to
 return to the page i came from. Also if i then click volgende i remain
 on the first page, clicking volgende again takes me to the 2nd page.

 @Gerolf er op uit could be loosely translated as going places or
 taking a trip.

 Maurice

 On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
  Hi all,
 
   A new Wicket site is born! It's a Dutch site on which you can search for
 day
   trips and such. See: www.eropuit.nl.
 
   Thanks to the user- and dev-group for answering any questions we had
 during
   the process.
 
   Lars
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread Andrea Jahn


 

Hi,

thanks for the test example. With the help of that I found the error in the 
policy file:
the permission of the page must not contain the inherit action, when there are 
secure components on the page, which are not permitted.

 

grant principal org.apache.wicket.security.hive.authorization.SimplePrincipal 
APPL_TEST
{
 permission ${ComponentPermission} ${front}.ProductAreaListPage, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
};

Now a user with permission APPL_TEST can open the page ProductAreaListPage, 
but he cannot see the secure component resultHiddenPanel.
When the action inherit is added to the first line, the resultHiddenPanel 
is visible.

I need the second line, because the user calls the page via the menu (link).

 

grant principal org.apache.wicket.security.hive.authorization.SimplePrincipal 
APPL_ADMIN
{
 permission ${ComponentPermission} 
${front}.ProductAreaListPage:resultHiddenPanel, inherit, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
};

A user who has the permission APPL_ADMIN can see the page and the secure 
component resultHiddenPanel.
So am I right, that the first line implies the security permission for the page 
?

 

I have changed to 1.3-SNAPSHOT and I will go on working with that.

Andrea


*Von:* users@wicket.apache.org
*Gesendet:* 14.05.08 00:07:49
*An:* users@wicket.apache.org
*Betreff:* Re: Swarm: Authorization for WebMarkupContainer



Ok, so i did some testing (and in the process found another bug,
unrelated to your issue :)), but i could not reproduce your permission
denied.
Here is my simple setup:

public class ContainerPage2 extends SecureWebPage
{

/**
* Construct.
*/
public ContainerPage2()
{
add(new Label(label, always visible));
SecureMarkupContainer container = new SecureMarkupContainer(secure);
container.add(new Label(hidden, hidden label));
add(container);
}

/**
* Simple secure container.
*
* @author marrink
*/
private static final class SecureMarkupContainer extends WebMarkupContainer
implements
ISecureComponent
{
/**
*
*/
private static final long serialVersionUID = 1L;

/**
*
* Construct.
*
* @param id
*/
public SecureMarkupContainer(String id)
{
super(id);
setSecurityCheck(new ContainerSecurityCheck(this));
}

/**
*
* @see org.apache.wicket.security.components.ISecureComponent#getSecurityCheck()
*/
public ISecurityCheck getSecurityCheck()
{
return SecureComponentHelper.getSecurityCheck(this);
}

/**
*
* @see 
org.apache.wicket.security.components.ISecureComponent#isActionAuthorized(java.lang.String)
*/
public boolean isActionAuthorized(String waspAction)
{
return SecureComponentHelper.isActionAuthorized(this, waspAction);
}

/**
*
* @see 
org.apache.wicket.security.components.ISecureComponent#isActionAuthorized(org.apache.wicket.security.actions.WaspAction)
*/
public boolean isActionAuthorized(WaspAction action)
{
return SecureComponentHelper.isActionAuthorized(this, action);
}

/**
*
* @see org.apache.wicket.security.components.ISecureComponent#isAuthenticated()
*/
public boolean isAuthenticated()
{
return SecureComponentHelper.isAuthenticated(this);
}

/**
*
* @see 
org.apache.wicket.security.components.ISecureComponent#setSecurityCheck(org.apache.wicket.security.checks.ISecurityCheck)
*/
public void setSecurityCheck(ISecurityCheck check)
{
SecureComponentHelper.setSecurityCheck(this, check);
}

}

}

and my policy file looks like this:

grant principal ${SimplePrincipal} container4
{
//this does not permit secure components on a ContainerPage2 to be visible
permission ${ComponentPermission} ${myPackage}.ContainerPage2, render;
permission ${ComponentPermission} ${myPackage}.ContainerPage2, enable;
};
grant principal ${SimplePrincipal} container5
{
//this grants the permission to any component with id secure on a
ContainerPage2
permission ${ComponentPermission}
${myPackage}.ContainerPage2:secure, inherit, render;
permission ${ComponentPermission} ${myPackage}.ContainerPage2, enable;
};
grant principal ${SimplePrincipal} container6
{
//this grants the permission to any SecureMarkupContainer inside a
ContainerPage2
permission ${ComponentPermission}
${myPackage}.ContainerPage2:${myPackage}.ContainerPage2$SecureMarkupContainer,
inherit, render;
permission ${ComponentPermission} ${myPackage}.ContainerPage2, enable;
};
grant principal ${SimplePrincipal} container7
{
//this grants the permission to any SecureMarkupContainer, even when
placed on other pages (if it wasn't a private class)
permission ${ComponentPermission}
${myPackage}.ContainerPage2$SecureMarkupContainer, inherit,
render;
permission ${ComponentPermission} ${myPackage}.ContainerPage2, enable;
};

Argh, i am only just reading you are using 1.3.1-SNAPSHOT. You should
be using 1.3-SNAPSHOT. That does it i am deleting those jars.

Maurice

On Tue, May 13, 2008 at 8:10 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 On Tue, May 13, 2008 at 6:48 PM, Andrea Jahn [EMAIL PROTECTED] wrote:
 
  Hi,
 

  I've changed to the 

ReloadingWicketFilter for Classes in a referenced project?

2008-05-14 Thread Norman Rosner
Hi there,

i'm trying to create a ReloadingWicketFilter. I've tried a lot especially
reading (WICKET-685) ReloadingWicketFilter not working with markup
inheritance (
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01938.html) but
nothing worked for me.

My created ReloadingWicketFilter works fine for the classes i wish to reload
if they are in the project. But if I want to reload classes that are in a
referenced project it doesn't work with my ReloadingWicketFilter. Could it
be that the ReloadingFilter is not able to reload classes from a referenced
project?


I'm new to wicket so please be nice ;)


Thanks in advance!

regards,

norman


Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread Maurice Marrink
On Wed, May 14, 2008 at 11:53 AM, Andrea Jahn [EMAIL PROTECTED] wrote:




  Hi,

  thanks for the test example. With the help of that I found the error in the 
 policy file:
  the permission of the page must not contain the inherit action, when there 
 are secure components on the page, which are not permitted.

Thats why i asked :)




  grant principal 
 org.apache.wicket.security.hive.authorization.SimplePrincipal APPL_TEST
  {
   permission ${ComponentPermission} ${front}.ProductAreaListPage, render;
   permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
  };

  Now a user with permission APPL_TEST can open the page 
 ProductAreaListPage, but he cannot see the secure component 
 resultHiddenPanel.
  When the action inherit is added to the first line, the 
 resultHiddenPanel is visible.

  I need the second line, because the user calls the page via the menu (link).

Correct, however you can shorten it to one permission with a render,
enable action.
The reason i always split my permissions inherit, render and
enable is because i often want all child components to be visible
but not all of them editable (enabled)
In this case there is no inherit action and thus you can put
everything in 1 permission.




  grant principal 
 org.apache.wicket.security.hive.authorization.SimplePrincipal APPL_ADMIN
  {
   permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultHiddenPanel, inherit, render;
   permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
  };

  A user who has the permission APPL_ADMIN can see the page and the secure 
 component resultHiddenPanel.
  So am I right, that the first line implies the security permission for the 
 page ?

Both do actually. inherit render is for visibility and to allow
users to instantiate that page. (page instantiation is actually the
access action but it is implied by every other action and therefore
can be omitted from the policy. It is used internally though).
enable is used by SecurePageLinks. For example if i have a
SecurePageLink link on a Page A pointing to Page B and i want only
specific users to have access to B then i would add permission
${ComponentPermission} B, enable;
for those users. every other user will not see the link. although it
is logical if you think about it it is different from other components
where a permission ${ComponentPermission} A:link, render; or
permission ${ComponentPermission} A, inherit, render; would be
required. This behavior can be changed though :)

Hmm reading back the above i can see how you might get a bit confused.
I was just trying to explain it, maybe a bit to condensed.
Anyhow most people require both permissions :)

Maurice



  I have changed to 1.3-SNAPSHOT and I will go on working with that.


  Andrea


  *Von:* users@wicket.apache.org
  *Gesendet:* 14.05.08 00:07:49

 *An:* users@wicket.apache.org
  *Betreff:* Re: Swarm: Authorization for WebMarkupContainer





 Ok, so i did some testing (and in the process found another bug,
  unrelated to your issue :)), but i could not reproduce your permission
  denied.
  Here is my simple setup:

  public class ContainerPage2 extends SecureWebPage
  {

  /**
  * Construct.
  */
  public ContainerPage2()
  {
  add(new Label(label, always visible));
  SecureMarkupContainer container = new SecureMarkupContainer(secure);
  container.add(new Label(hidden, hidden label));
  add(container);
  }

  /**
  * Simple secure container.
  *
  * @author marrink
  */
  private static final class SecureMarkupContainer extends WebMarkupContainer
  implements
  ISecureComponent
  {
  /**
  *
  */
  private static final long serialVersionUID = 1L;

  /**
  *
  * Construct.
  *
  * @param id
  */
  public SecureMarkupContainer(String id)
  {
  super(id);
  setSecurityCheck(new ContainerSecurityCheck(this));
  }

  /**
  *
  * @see 
 org.apache.wicket.security.components.ISecureComponent#getSecurityCheck()
  */
  public ISecurityCheck getSecurityCheck()
  {
  return SecureComponentHelper.getSecurityCheck(this);
  }

  /**
  *
  * @see 
 org.apache.wicket.security.components.ISecureComponent#isActionAuthorized(java.lang.String)
  */
  public boolean isActionAuthorized(String waspAction)
  {
  return SecureComponentHelper.isActionAuthorized(this, waspAction);
  }

  /**
  *
  * @see 
 org.apache.wicket.security.components.ISecureComponent#isActionAuthorized(org.apache.wicket.security.actions.WaspAction)
  */
  public boolean isActionAuthorized(WaspAction action)
  {
  return SecureComponentHelper.isActionAuthorized(this, action);
  }

  /**
  *
  * @see 
 org.apache.wicket.security.components.ISecureComponent#isAuthenticated()
  */
  public boolean isAuthenticated()
  {
  return SecureComponentHelper.isAuthenticated(this);
  }

  /**
  *
  * @see 
 org.apache.wicket.security.components.ISecureComponent#setSecurityCheck(org.apache.wicket.security.checks.ISecurityCheck)
  */
  public void setSecurityCheck(ISecurityCheck check)
  {
  

Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread Andrea Jahn



I just tried to reproduce the problem, why the resultHiddenPanel was not 
visible, when I used the ContainerSecurityCheck in the class 
SecureWebMarkupContainer (what I do now also). I used the old policy file, the 
PolicyFileHiveFactory instead of the SwarmPolicyFileHiveFactory, ... but I 
cannot reproduce the permission denied.

Now it always works correct ;-)

I think the reason is eliminated in 1.3-SNAPSHOT .

Now I will try to secure other types of components on the pages, test the 
different settings for the permissions you explained below and after that I 
have to find out how to set data permissions.

Andrea

*Von:* users@wicket.apache.org
*Gesendet:* 14.05.08 12:35:11
*An:* users@wicket.apache.org
*Betreff:* Re: Swarm: Authorization for WebMarkupContainer



On Wed, May 14, 2008 at 11:53 AM, Andrea Jahn [EMAIL PROTECTED] wrote:




 Hi,

 thanks for the test example. With the help of that I found the error in the 
 policy file:
 the permission of the page must not contain the inherit action, when there 
 are secure components on the page, which are not permitted.

Thats why i asked :)




 grant principal org.apache.wicket.security.hive.authorization.SimplePrincipal 
 APPL_TEST
 {
 permission ${ComponentPermission} ${front}.ProductAreaListPage, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
 };

 Now a user with permission APPL_TEST can open the page ProductAreaListPage, 
 but he cannot see the secure component resultHiddenPanel.
 When the action inherit is added to the first line, the resultHiddenPanel 
 is visible.

 I need the second line, because the user calls the page via the menu (link).

Correct, however you can shorten it to one permission with a render,
enable action.
The reason i always split my permissions inherit, render and
enable is because i often want all child components to be visible
but not all of them editable (enabled)
In this case there is no inherit action and thus you can put
everything in 1 permission.




 grant principal org.apache.wicket.security.hive.authorization.SimplePrincipal 
 APPL_ADMIN
 {
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultHiddenPanel, inherit, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
 };

 A user who has the permission APPL_ADMIN can see the page and the secure 
 component resultHiddenPanel.
 So am I right, that the first line implies the security permission for the 
 page ?

Both do actually. inherit render is for visibility and to allow
users to instantiate that page. (page instantiation is actually the
access action but it is implied by every other action and therefore
can be omitted from the policy. It is used internally though).
enable is used by SecurePageLinks. For example if i have a
SecurePageLink link on a Page A pointing to Page B and i want only
specific users to have access to B then i would add permission
${ComponentPermission} B, enable;
for those users. every other user will not see the link. although it
is logical if you think about it it is different from other components
where a permission ${ComponentPermission} A:link, render; or
permission ${ComponentPermission} A, inherit, render; would be
required. This behavior can be changed though :)

Hmm reading back the above i can see how you might get a bit confused.
I was just trying to explain it, maybe a bit to condensed.
Anyhow most people require both permissions :)

Maurice



 I have changed to 1.3-SNAPSHOT and I will go on working with that.


 Andrea


 *Von:* users@wicket.apache.org
 *Gesendet:* 14.05.08 00:07:49

 *An:* users@wicket.apache.org
 *Betreff:* Re: Swarm: Authorization for WebMarkupContainer





 Ok, so i did some testing (and in the process found another bug,
 unrelated to your issue :)), but i could not reproduce your permission
 denied.
 Here is my simple setup:

 public class ContainerPage2 extends SecureWebPage
 {

 /**
 * Construct.
 */
 public ContainerPage2()
 {
 add(new Label(label, always visible));
 SecureMarkupContainer container = new SecureMarkupContainer(secure);
 container.add(new Label(hidden, hidden label));
 add(container);
 }

 /**
 * Simple secure container.
 *
 * @author marrink
 */
 private static final class SecureMarkupContainer extends WebMarkupContainer
 implements
 ISecureComponent
 {
 /**
 *
 */
 private static final long serialVersionUID = 1L;

 /**
 *
 * Construct.
 *
 * @param id
 */
 public SecureMarkupContainer(String id)
 {
 super(id);
 setSecurityCheck(new ContainerSecurityCheck(this));
 }

 /**
 *
 * @see 
 org.apache.wicket.security.components.ISecureComponent#getSecurityCheck()
 */
 public ISecurityCheck getSecurityCheck()
 {
 return SecureComponentHelper.getSecurityCheck(this);
 }

 /**
 *
 * @see 
 org.apache.wicket.security.components.ISecureComponent#isActionAuthorized(java.lang.String)
 */
 public boolean isActionAuthorized(String waspAction)
 {
 return SecureComponentHelper.isActionAuthorized(this, waspAction);
 }

 

Re: Swarm: Authorization for WebMarkupContainer

2008-05-14 Thread Maurice Marrink
On Wed, May 14, 2008 at 1:10 PM, Andrea Jahn [EMAIL PROTECTED] wrote:



 I just tried to reproduce the problem, why the resultHiddenPanel was not 
 visible, when I used the ContainerSecurityCheck in the class 
 SecureWebMarkupContainer (what I do now also). I used the old policy file, 
 the PolicyFileHiveFactory instead of the SwarmPolicyFileHiveFactory, ... but 
 I cannot reproduce the permission denied.

 Now it always works correct ;-)

 I think the reason is eliminated in 1.3-SNAPSHOT .

Correct, the 1.3.1-SNAPSHOT contained old code.


 Now I will try to secure other types of components on the pages, test the 
 different settings for the permissions you explained below and after that I 
 have to find out how to set data permissions.

I just committed a DataSecurityCheck ( a very simple class) to help
you do just that. just use it like any other ISecurityCheck (e.g
ContainerSecurityCheck)

Maurice


 Andrea

 *Von:* users@wicket.apache.org
 *Gesendet:* 14.05.08 12:35:11
 *An:* users@wicket.apache.org
 *Betreff:* Re: Swarm: Authorization for WebMarkupContainer



 On Wed, May 14, 2008 at 11:53 AM, Andrea Jahn [EMAIL PROTECTED] wrote:




 Hi,

 thanks for the test example. With the help of that I found the error in the 
 policy file:
 the permission of the page must not contain the inherit action, when there 
 are secure components on the page, which are not permitted.

 Thats why i asked :)




 grant principal 
 org.apache.wicket.security.hive.authorization.SimplePrincipal APPL_TEST
 {
 permission ${ComponentPermission} ${front}.ProductAreaListPage, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
 };

 Now a user with permission APPL_TEST can open the page 
 ProductAreaListPage, but he cannot see the secure component 
 resultHiddenPanel.
 When the action inherit is added to the first line, the 
 resultHiddenPanel is visible.

 I need the second line, because the user calls the page via the menu (link).

 Correct, however you can shorten it to one permission with a render,
 enable action.
 The reason i always split my permissions inherit, render and
 enable is because i often want all child components to be visible
 but not all of them editable (enabled)
 In this case there is no inherit action and thus you can put
 everything in 1 permission.




 grant principal 
 org.apache.wicket.security.hive.authorization.SimplePrincipal APPL_ADMIN
 {
 permission ${ComponentPermission} 
 ${front}.ProductAreaListPage:resultHiddenPanel, inherit, render;
 permission ${ComponentPermission} ${front}.ProductAreaListPage, enable;
 };

 A user who has the permission APPL_ADMIN can see the page and the secure 
 component resultHiddenPanel.
 So am I right, that the first line implies the security permission for the 
 page ?

 Both do actually. inherit render is for visibility and to allow
 users to instantiate that page. (page instantiation is actually the
 access action but it is implied by every other action and therefore
 can be omitted from the policy. It is used internally though).
 enable is used by SecurePageLinks. For example if i have a
 SecurePageLink link on a Page A pointing to Page B and i want only
 specific users to have access to B then i would add permission
 ${ComponentPermission} B, enable;
 for those users. every other user will not see the link. although it
 is logical if you think about it it is different from other components
 where a permission ${ComponentPermission} A:link, render; or
 permission ${ComponentPermission} A, inherit, render; would be
 required. This behavior can be changed though :)

 Hmm reading back the above i can see how you might get a bit confused.
 I was just trying to explain it, maybe a bit to condensed.
 Anyhow most people require both permissions :)

 Maurice



 I have changed to 1.3-SNAPSHOT and I will go on working with that.


 Andrea


 *Von:* users@wicket.apache.org
 *Gesendet:* 14.05.08 00:07:49

 *An:* users@wicket.apache.org
 *Betreff:* Re: Swarm: Authorization for WebMarkupContainer





 Ok, so i did some testing (and in the process found another bug,
 unrelated to your issue :)), but i could not reproduce your permission
 denied.
 Here is my simple setup:

 public class ContainerPage2 extends SecureWebPage
 {

 /**
 * Construct.
 */
 public ContainerPage2()
 {
 add(new Label(label, always visible));
 SecureMarkupContainer container = new SecureMarkupContainer(secure);
 container.add(new Label(hidden, hidden label));
 add(container);
 }

 /**
 * Simple secure container.
 *
 * @author marrink
 */
 private static final class SecureMarkupContainer extends WebMarkupContainer
 implements
 ISecureComponent
 {
 /**
 *
 */
 private static final long serialVersionUID = 1L;

 /**
 *
 * Construct.
 *
 * @param id
 */
 public SecureMarkupContainer(String id)
 {
 super(id);
 setSecurityCheck(new ContainerSecurityCheck(this));
 }

 /**
 *
 * @see 
 org.apache.wicket.security.components.ISecureComponent#getSecurityCheck()
 */
 public 

Re: FYI: new wicket site

2008-05-14 Thread Johan Compagner
ahh with view source i can finally see that it is really wicket ;)
its not that you dont use any javascript... man what an includes :)

johan


On Wed, May 14, 2008 at 10:52 AM, Maurice Marrink [EMAIL PROTECTED] wrote:

 nice :)

 one thing though: i went searching for uitjes and after clicking the
 volgende button a couple of times i selected one to show more details.
 Now when i use the browser backbutton or the terug link i always end
 up at the first page of my search results. I would have expected to
 return to the page i came from. Also if i then click volgende i remain
 on the first page, clicking volgende again takes me to the 2nd page.

 @Gerolf er op uit could be loosely translated as going places or
 taking a trip.

 Maurice

 On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
  Hi all,
 
   A new Wicket site is born! It's a Dutch site on which you can search
 for day
   trips and such. See: www.eropuit.nl.
 
   Thanks to the user- and dev-group for answering any questions we had
 during
   the process.
 
   Lars
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Johan Compagner
but what did you do there in that method?
nothing? you dont cache anything anymore?

On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED] wrote:

 Hello everyone.

 I override Localizer.putIntoCache method. and it really reduce the
 heapsize
 usage of Localizer.

 The application is more stable now although the key remains large.

 Hope we can find a way to shorter the key length.

 thanks everyone.

 2008/5/13 Eirik Rude [EMAIL PROTECTED]:

 
  A soft reference is very common for this type of thing.  I know some of
  ICU's
  resources are stored this way.
 
 
 
  Jonathan Locke wrote:
  
  
   maybe localizer should limit its size or use a soft reference cache?
  
  
   Johan Compagner wrote:
  
   Can you really see what it holds?
   Almost 2G in memory in localizer is extreme... Thats really a lot of
   strings..
   You could try to read that dump with yourkit if your current one
   doesnt show enough.
  
   On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
   Hello everyone.
  
   I recently develop my App use Wicket1.3.3. It's my first time to use
   this
   framework and I feel it's really really a perfect framework for me.
   My app support both Simplified Chinese , Traditional Chinese, I
   implement
   this with Wicket i18n feature.
   With the load increasing these days, I found my app would become
 very
   lag
   abount every 24 hours ,so that i would only restart it
   without any choice.
   when I found the lag, My log records many Exceptions like :
   after 1 minute the Pagemap null is still locked by:
   Thread[http-8080-321,5,main], giving
   up trying to get the page for path xxx
  
   I check the JVM status with jstat -gc , It tells that the Heapsize
 is
   full
   even after full GC.
   My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
   -XX:MaxPermSize=250m
   My deploy server has 2*CPU and 4G memory, Redhat AS4 OS + tomcat
 6.0.
   There're 2000 sessions on the day while the timeout threshold is 15
   minutes.
   So i dump the whole heapsize with the command  jmap
   -dump:live,format=b,file=3.dump.hprof processid
   and i truely get a 2G size dump files. I use SAP Memory Analyer to
 see
   what're stored in HeapMemory.
   and I found a strange number of Retained Heap usage:
   Classname
ShallowHeap
 RetainHeap
 RetainedHeap%
   [EMAIL PROTECTED]
   16
   1,755,070,35287.64%
[EMAIL PROTECTED]
   48 1,755,070,336
  87.69%
 [EMAIL PROTECTED]
33,554,448
1,755,069,632   87.69%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -  [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
 + 2,863,659 more...
  
   Is that means that the Localizer Object used most of the heap size?
   or Is this number normal for Wicket App?
  
   I wonder whether I forget to release the memory by my mis-using of
  i18n
   feature?
   Is there any attentions I must pay to when dealing with Localizer?
  
   This problem annoys me more the 2 weeks. I really need some help.
  Thanks
   .
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Why-Localizer-Retained-so-many-heapsize--tp17142582p17199950.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: persistent sessions in Tomcat

2008-05-14 Thread Johan Compagner
then you really have  a serialization problem in your pages


On Wed, May 14, 2008 at 10:23 AM, ElSe [EMAIL PROTECTED] wrote:



 Thanks, I tried to check this for wicket examples and it works with
 default
 server configuration. This means that there are some error in my
 application... but I haven't any error messages... ok, I'll continue
 experiments.
 Does that message page expired mean that the session is gone? So I have
 next question: default session timeout for Tomcat is 30 minutes but page
 expired appears much earlier - even for wicket examples. Why?

 Johan Compagner wrote:
 
  the default config of tomcat already restarts the wicket example
 sessions
  just fine for me
  I havent changed 1 thing about that
 
 
  On Tue, May 13, 2008 at 11:59 AM, ElSe [EMAIL PROTECTED] wrote:
 
 
  Do you mean tomcat logs? No I don't. Some *.ser files appear  in the
  work\Catalina\localhost\application directory so session is
 serialized
  but
  isn't restored.
 
  Do I understand correctly that my assumption is correct and the wicket
  session must be restored with the tomcat persistent manager? So there
  must
  be some error in the configuration of the server or application itself?
 
 
  igor.vaynberg wrote:
  
   do you get any serialization errors in your logs, you might be trying
   to store something non serializable in the wicket component.
  
   -igor
  
  
   On Mon, May 12, 2008 at 1:09 AM, ElSe [EMAIL PROTECTED] wrote:
  
Hi,
  
I'm just started experiments with Wicket so I suppose my question
 is
   stupid
however I haven't found the answer on the forum.
  
The point was to understand how to organize persistent sessions for
  the
wicket application. It seemed to me that such application should
 work
   with
the standard Tomcat mechanism transparently as any other servlet.
So I have written simple wicket application - just two pages that
  show
sessionid, configured Tomcat persistent manager and  started
 session.
   Then I
restarted the server and tried to pass from one page to another
  waiting
   to
see  the same sessionid. But I have seen page has expired.
Should I provide some serialization support in my application or
  there
   is
some error in my logic or there aren't such possibility and I want
something strange(c)?
  
BR
--
View this message in context:
  
 
 http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17183181.html
Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
  
  -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17205069.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/persistent-sessions-in-Tomcat-tp17183181p17226017.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Processing a form before page components are created

2008-05-14 Thread Joel Halbert

I take your point, thanks for the pointer.

--
From: Eelco Hillenius [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 1:31 AM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created

 The reason I want to do this is that my pages are stateless, and I want 
to

process the submitted form before all the components on the page are
initialised, incase I need to load different data models, or redirect the
request to another page, thus saving unnecessary database calls and
component initialisation.

 At the moment what I am doing is processing the form by directly reading
the page parameters in the constructor before I add any components to the
page, and then redirecting the request or initializing the page as
appropriate (bypassing the use of Form.onSubmit).


If you make sure your models/ components work lazily you can avoid
database calls being done until the components are actually rendered.
Rendering is a separate phase executing after component construction
and form handling. And you can let your form just populate a simple
bean to avoid database access. I wouldn't worry about the creation of
a few components, and you can break of any time with a
RestartResponseException or set the next page (without breaking off
current processing) using setResponsePage.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Quan Zhou
   getResourceSettings().setLocalizer(new Localizer() {
@Override
public void putIntoCache(final String cacheKey,final String
string) {
if (string != null  cacheKey!=null)
super.putIntoCache(cacheKey, string);
}
});



2008/5/14 Johan Compagner [EMAIL PROTECTED]:

 but what did you do there in that method?
 nothing? you dont cache anything anymore?

 On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED] wrote:

  Hello everyone.
 
  I override Localizer.putIntoCache method. and it really reduce the
  heapsize
  usage of Localizer.
 
  The application is more stable now although the key remains large.
 
  Hope we can find a way to shorter the key length.
 
  thanks everyone.
 
  2008/5/13 Eirik Rude [EMAIL PROTECTED]:
 
  
   A soft reference is very common for this type of thing.  I know some of
   ICU's
   resources are stored this way.
  
  
  
   Jonathan Locke wrote:
   
   
maybe localizer should limit its size or use a soft reference cache?
   
   
Johan Compagner wrote:
   
Can you really see what it holds?
Almost 2G in memory in localizer is extreme... Thats really a lot of
strings..
You could try to read that dump with yourkit if your current one
doesnt show enough.
   
On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
Hello everyone.
   
I recently develop my App use Wicket1.3.3. It's my first time to
 use
this
framework and I feel it's really really a perfect framework for me.
My app support both Simplified Chinese , Traditional Chinese, I
implement
this with Wicket i18n feature.
With the load increasing these days, I found my app would become
  very
lag
abount every 24 hours ,so that i would only restart it
without any choice.
when I found the lag, My log records many Exceptions like :
after 1 minute the Pagemap null is still locked by:
Thread[http-8080-321,5,main], giving
up trying to get the page for path xxx
   
I check the JVM status with jstat -gc , It tells that the Heapsize
  is
full
even after full GC.
My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
-XX:MaxPermSize=250m
My deploy server has 2*CPU and 4G memory, Redhat AS4 OS + tomcat
  6.0.
There're 2000 sessions on the day while the timeout threshold is 15
minutes.
So i dump the whole heapsize with the command  jmap
-dump:live,format=b,file=3.dump.hprof processid
and i truely get a 2G size dump files. I use SAP Memory Analyer to
  see
what're stored in HeapMemory.
and I found a strange number of Retained Heap usage:
Classname
 ShallowHeap
  RetainHeap
  RetainedHeap%
[EMAIL PROTECTED]
16
1,755,070,35287.64%
 [EMAIL PROTECTED]
48 1,755,070,336
   87.69%
  [EMAIL PROTECTED]
 ...
 33,554,448
 1,755,069,632   87.69%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
   -
  [EMAIL PROTECTED]
   ...
   24   3928
0.00%
  + 2,863,659 more...
   
Is that means that the Localizer Object used most of the heap size?
or Is this number normal for Wicket App?
   
I wonder whether I forget to release the memory by my mis-using of
   i18n
feature?
Is there any attentions I must pay to when dealing with Localizer?
   
This problem annoys me more the 2 weeks. I really need some help.
   Thanks
.
   
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
   
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/Why-Localizer-Retained-so-many-heapsize--tp17142582p17199950.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe

Somewhat related to this thread, when I moved to generics win Wicket 1.4,  I
created some utility classes such as:

public class VoidContainer extends WebMarkupContainerlt;Void
public class VoidPanel extends Panellt;Void
public class StringLabel extends Labellt;String

public class IntegerModel extends Modellt;Integer
public class StringModel extends Modellt;String
public class DateModel extends Modellt;Date
public class DoubleModel extends Modellt;Double

And so on.  This made my wicket code cleaner and easier to use.  I think the
Wicket 1.4 generics implementation is headed in the right direction.  It was
a pain at first because I had to parameterize everything, but creating
convenience classes like this made it easier.

I'm thinking about creating a patch with a suite of these types of classes
because I think users will want something like this.

-Doug


Johan Compagner wrote:
 
 The problem is that wicket needs an annotation
 
 genericsOptional
 
 so that all the warnings about raw types are gone.
 
 A component only has to be generic if you use the IModel constructor or
 call
 getModel(), getModelObject() methods..
 for the rest it is not really needed
 
 johan
 
 On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk [EMAIL PROTECTED]
 wrote:
 
 My post kind of missed the point, I shouldn't post when I'm already half
 asleep. :-)

 Obviously MarkupContainer satisfies the MarkupContainer? in a
 method argument, so it accepts the raw type. However, it generates a
 warning
 because the method says it's generified, so you should be using the
 generic
 type.

 Johan Compagner wrote:

  I dont care, because i cant do any thing with the ? The only thing it
  enforces is that it must now be a generic class which is annoying. Not
  to mention that in that area eclipse and javac accept different
  things
 

 The reason it warns you to use generics when generics are wanted is
 because Sun wants to be able to make it *required* (in a future release)
 to
 use generics where generics are wanted; at least, so I read... I think in
 the real world they wouldn't dare to do this because it would piss off so
 many users and break so much stuff. :-)

 But the idea is that if something is generified you should be using a
 type
 parameter, and using a raw type is *purely* for backwards compatibility
 with
 legacy code.

 Regards,
 Sebastiaan

  So or we in wicket dont use ? any where and have supress warning
  everywhere for that or we do use it and then suddenly it is in my eyes
  restricted to much.
 

 I don't understand


  On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 
   Johan Compagner wrote:
  
yes thats the reason
   
you are calling the method add with a generified component but that
container itself is not generified
   
i dont like this about generics expecially the onces like this:
   
add(MarkupContainer? container)
   
then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none
generics
   
   No, that's not correct. For example, List? is much more restrictive
   than a raw List (which is a List). To a raw list you can add
   an
   instance of any type whatever, i.e., list.add(new Object()). But in
   List? the ? is a wildcard which says it could be any type there,
   i.e.,
   it could be a ListInteger. But you can't add a new Object() to a
   ListInteger!
  
   Thus MarkupContainer? means MarkupContainer parameterized by some
   unknown type, and *not* MarkupContainer parameterized by Object,
   which
   is what the raw type means.
  
   Regards,
   Sebastiaan
  
johan
   
   
On Tue, May 13, 2008 at 5:55 PM, Stefan Simik 
[EMAIL PROTECTED]
wrote:
   
 I have one idea,

 the reason of the warnigs is, that parent of AjaxPagingNavigator
 is
 PagingNavigator,
 which has parent Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:

  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
  ListView
 
 
 ---
  ListViewInteger menu = new ListViewInteger(id, numbers){
 //populate metods
  }
  add(menu);//warning here
 
  The warning says:
  Type safety: The method add(Component...) belongs to the raw
  type
  MarkupContainer.
  References to generic type MarkupContainerT should be
  parameterized
 
  I cannot find out, what's the warning reason, because ListView
  self is
  parameterized.
 
 
  

RE: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Hoover, William
imho, that seems like that adds a lot of unnecessary code. One of the
nice things about Wicket is that it keeps the bloat to a minimum.

-Original Message-
From: Doug Donohoe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 14, 2008 8:21 AM
To: users@wicket.apache.org
Subject: Re: Using generics with some non-generic classes in Wicket


Somewhat related to this thread, when I moved to generics win Wicket
1.4,  I created some utility classes such as:

public class VoidContainer extends WebMarkupContainerlt;Void public
class VoidPanel extends Panellt;Void public class StringLabel extends
Labellt;String

public class IntegerModel extends Modellt;Integer public class
StringModel extends Modellt;String public class DateModel extends
Modellt;Date public class DoubleModel extends Modellt;Double

And so on.  This made my wicket code cleaner and easier to use.  I think
the Wicket 1.4 generics implementation is headed in the right direction.
It was a pain at first because I had to parameterize everything, but
creating convenience classes like this made it easier.

I'm thinking about creating a patch with a suite of these types of
classes because I think users will want something like this.

-Doug


Johan Compagner wrote:
 
 The problem is that wicket needs an annotation
 
 genericsOptional
 
 so that all the warnings about raw types are gone.
 
 A component only has to be generic if you use the IModel constructor 
 or call getModel(), getModelObject() methods..
 for the rest it is not really needed
 
 johan
 
 On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk 
 [EMAIL PROTECTED]
 wrote:
 
 My post kind of missed the point, I shouldn't post when I'm already 
 half asleep. :-)

 Obviously MarkupContainer satisfies the MarkupContainer? in a 
 method argument, so it accepts the raw type. However, it generates a 
 warning because the method says it's generified, so you should be 
 using the generic type.

 Johan Compagner wrote:

  I dont care, because i cant do any thing with the ? The only thing 
  it enforces is that it must now be a generic class which is 
  annoying. Not to mention that in that area eclipse and javac accept

  different things
 

 The reason it warns you to use generics when generics are wanted is 
 because Sun wants to be able to make it *required* (in a future 
 release) to use generics where generics are wanted; at least, so I 
 read... I think in the real world they wouldn't dare to do this 
 because it would piss off so many users and break so much stuff. :-)

 But the idea is that if something is generified you should be using a

 type parameter, and using a raw type is *purely* for backwards 
 compatibility with legacy code.

 Regards,
 Sebastiaan

  So or we in wicket dont use ? any where and have supress warning
  everywhere for that or we do use it and then suddenly it is in my 
  eyes restricted to much.
 

 I don't understand


  On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 
   Johan Compagner wrote:
  
yes thats the reason
   
you are calling the method add with a generified component but 
that container itself is not generified
   
i dont like this about generics expecially the onces like this:
   
add(MarkupContainer? container)
   
then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none 
generics
   
   No, that's not correct. For example, List? is much more 
   restrictive than a raw List (which is a List). To a raw list you 
   can add an instance of any type whatever, i.e., list.add(new 
   Object()). But in List? the ? is a wildcard which says it could

   be any type there, i.e., it could be a ListInteger. But you 
   can't add a new Object() to a ListInteger!
  
   Thus MarkupContainer? means MarkupContainer parameterized by 
   some unknown type, and *not* MarkupContainer parameterized by 
   Object, which is what the raw type means.
  
   Regards,
   Sebastiaan
  
johan
   
   
On Tue, May 13, 2008 at 5:55 PM, Stefan Simik  
[EMAIL PROTECTED]
wrote:
   
 I have one idea,

 the reason of the warnigs is, that parent of 
 AjaxPagingNavigator is PagingNavigator, which has parent 
 Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the 
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:

  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I 
  add a simple ListView
 
 
 -
 --
  ListViewInteger menu = new ListViewInteger(id,
numbers){
 //populate metods
  }
  add(menu);

Re: overriding getAssociatedMarkupStream

2008-05-14 Thread Eyal Golan
Hi,
I tried implementing the IMarkupResourceStreamProvider in my web page:
public IResourceStream getMarkupResourceStream(MarkupContainer
container,
Class containerClass) {
if (html != null) {
StringResourceStream myhtml = new StringResourceStream(new
StringBuilder(html));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
return m;
} else {
final DefaultMarkupResourceStreamProvider
markupResourceStreamProvider =
new DefaultMarkupResourceStreamProvider();
return
markupResourceStreamProvider.getMarkupResourceStream(container,
containerClass);
}
}

(html is a class member that may or may not be available)

It did not work:
1. The Cache keeps the last html markup, so if I open this page once WITH
html != null I get what I want (but with the same problem. look at next
note). If then I open the page and the html  IS null, the cache returns the
earlier page. So this approach is no good.

2. In any case, HeaderContributers that are on components that in the page
are not added to the output markup.

Are the 2 lines:
StringResourceStream myhtml = new StringResourceStream(new
StringBuilder(html));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
  The problem ?

Thanks

On Thu, May 8, 2008 at 6:41 AM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 you shouldnt be overriding that method, try implementing
 IMarkupResourceStreamProvider instead.

 -igor


 On Tue, May 6, 2008 at 11:20 PM, Eyal Golan [EMAIL PROTECTED] wrote:
  ok, maybe I wasn't clear enough.
   The simple question is, why the add(HeaderContributor.forCss...));
   is not added to the output markup when I override
 getAssociatedMarkupStream?
 
   Thanks
 
 
 
   On Tue, May 6, 2008 at 4:08 PM, Eyal Golan [EMAIL PROTECTED] wrote:
 
Hi all,
We have this method:
@Override
public MarkupStream getAssociatedMarkupStream(final boolean
throwException)
{
if(html != null) {
return GUIUtis.getMarkupStream(this, html);
}
return super.getAssociatedMarkupStream(throwException);
}
   
and:
static public MarkupStream getMarkupStream(Page page,String
 htmlText){
try
{
StringResourceStream myhtml = new StringResourceStream(new
StringBuilder(htmlText));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
Markup myMarkup =
   
 page.getApplication().getMarkupSettings().getMarkupParserFactory().newMarkupParser(m).parse();
MarkupStream markupStream = new MarkupStream(myMarkup);
return markupStream;
}
catch (Exception ex)
{
throw new RuntimeException(Fail to parse
markup:\n+htmlText);
}
}
   
The problem:
When the html is not null (and we enter GUIUtis.getMarkupStream),
css that where added using HeaderContributer are not added to the
 output
HTML markup.
I have something like this in a component:
add(HeaderContributor.forCss(EurekifyButton.class,
 EurekifyButton.css));
The css is missing.
   
I can't change the usage of getAssociatedMarkupStream to use variation
 or
something like this.
   
any thought?
--
Eyal Golan
[EMAIL PROTECTED]
   
Visit: http://jvdrums.sourceforge.net/
 
 
 
 
   --
   Eyal Golan
   [EMAIL PROTECTED]
 
   Visit: http://jvdrums.sourceforge.net/
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Martijn Dashorst
I can save you the trouble of generating the patch. I don't want
FooBar where Foo iterates over all the types in Java and Bar iterates
over all the Components, Behaviors, Sessions, Requests, Providers in
Wicket. Totally unnecessary and completely negates the idea of
generics.

Martijn

On 5/14/08, Doug Donohoe [EMAIL PROTECTED] wrote:

  Somewhat related to this thread, when I moved to generics win Wicket 1.4,  I
  created some utility classes such as:

  public class VoidContainer extends WebMarkupContainerlt;Void
  public class VoidPanel extends Panellt;Void
  public class StringLabel extends Labellt;String

  public class IntegerModel extends Modellt;Integer
  public class StringModel extends Modellt;String
  public class DateModel extends Modellt;Date
  public class DoubleModel extends Modellt;Double

  And so on.  This made my wicket code cleaner and easier to use.  I think the
  Wicket 1.4 generics implementation is headed in the right direction.  It was
  a pain at first because I had to parameterize everything, but creating
  convenience classes like this made it easier.

  I'm thinking about creating a patch with a suite of these types of classes
  because I think users will want something like this.

  -Doug



  Johan Compagner wrote:
  
   The problem is that wicket needs an annotation
  
   genericsOptional
  
   so that all the warnings about raw types are gone.
  
   A component only has to be generic if you use the IModel constructor or
   call
   getModel(), getModelObject() methods..
   for the rest it is not really needed
  
   johan
  
   On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk [EMAIL PROTECTED]
   wrote:
  
   My post kind of missed the point, I shouldn't post when I'm already half
   asleep. :-)
  

  Obviously MarkupContainer satisfies the MarkupContainer? in a

  method argument, so it accepts the raw type. However, it generates a
   warning
   because the method says it's generified, so you should be using the
   generic
   type.
  
   Johan Compagner wrote:
  
I dont care, because i cant do any thing with the ? The only thing it
enforces is that it must now be a generic class which is annoying. Not
to mention that in that area eclipse and javac accept different
things
   
  
   The reason it warns you to use generics when generics are wanted is
   because Sun wants to be able to make it *required* (in a future release)
   to
   use generics where generics are wanted; at least, so I read... I think in
   the real world they wouldn't dare to do this because it would piss off so
   many users and break so much stuff. :-)
  
   But the idea is that if something is generified you should be using a
   type
   parameter, and using a raw type is *purely* for backwards compatibility
   with
   legacy code.
  
   Regards,
   Sebastiaan
  
So or we in wicket dont use ? any where and have supress warning
everywhere for that or we do use it and then suddenly it is in my eyes
restricted to much.
   
  
   I don't understand
  
  
On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
   
 Johan Compagner wrote:

  yes thats the reason
 
  you are calling the method add with a generified component but that
  container itself is not generified
 
  i dont like this about generics expecially the onces like this:
 
  add(MarkupContainer? container)
 
  then suddenly a none generified component cant be added...
  thats really stupid ? should mean anything.. including none
  generics
 
 No, that's not correct. For example, List? is much more restrictive

than a raw List (which is a List). To a raw list you can add

an
 instance of any type whatever, i.e., list.add(new Object()). But in
 List? the ? is a wildcard which says it could be any type there,
 i.e.,
 it could be a ListInteger. But you can't add a new Object() to a
 ListInteger!

 Thus MarkupContainer? means MarkupContainer parameterized by some
 unknown type, and *not* MarkupContainer parameterized by Object,
 which
 is what the raw type means.

 Regards,
 Sebastiaan

  johan
 
 
  On Tue, May 13, 2008 at 5:55 PM, Stefan Simik 
  [EMAIL PROTECTED]
  wrote:
 
   I have one idea,
  
   the reason of the warnigs is, that parent of AjaxPagingNavigator
   is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
  
Mhmm, it is meaningful ;) I will know in future, thx
   
One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.
   
Example:  I have a simple 

Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Johan Compagner
ok so you dont store the tested cacheKey 's that returned null..
so that could result in a bit slower access because it is tried to resolve
everytime

I do think that my fix for not including the page is solving your real mem
leak problem

johan


On Wed, May 14, 2008 at 2:03 PM, Quan Zhou [EMAIL PROTECTED] wrote:

   getResourceSettings().setLocalizer(new Localizer() {
@Override
public void putIntoCache(final String cacheKey,final String
 string) {
if (string != null  cacheKey!=null)
super.putIntoCache(cacheKey, string);
}
});



 2008/5/14 Johan Compagner [EMAIL PROTECTED]:

  but what did you do there in that method?
  nothing? you dont cache anything anymore?
 
  On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED]
 wrote:
 
   Hello everyone.
  
   I override Localizer.putIntoCache method. and it really reduce the
   heapsize
   usage of Localizer.
  
   The application is more stable now although the key remains large.
  
   Hope we can find a way to shorter the key length.
  
   thanks everyone.
  
   2008/5/13 Eirik Rude [EMAIL PROTECTED]:
  
   
A soft reference is very common for this type of thing.  I know some
 of
ICU's
resources are stored this way.
   
   
   
Jonathan Locke wrote:


 maybe localizer should limit its size or use a soft reference
 cache?


 Johan Compagner wrote:

 Can you really see what it holds?
 Almost 2G in memory in localizer is extreme... Thats really a lot
 of
 strings..
 You could try to read that dump with yourkit if your current one
 doesnt show enough.

 On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
 Hello everyone.

 I recently develop my App use Wicket1.3.3. It's my first time to
  use
 this
 framework and I feel it's really really a perfect framework for
 me.
 My app support both Simplified Chinese , Traditional Chinese, I
 implement
 this with Wicket i18n feature.
 With the load increasing these days, I found my app would become
   very
 lag
 abount every 24 hours ,so that i would only restart it
 without any choice.
 when I found the lag, My log records many Exceptions like :
 after 1 minute the Pagemap null is still locked by:
 Thread[http-8080-321,5,main], giving
 up trying to get the page for path xxx

 I check the JVM status with jstat -gc , It tells that the
 Heapsize
   is
 full
 even after full GC.
 My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
 -XX:MaxPermSize=250m
 My deploy server has 2*CPU and 4G memory, Redhat AS4 OS + tomcat
   6.0.
 There're 2000 sessions on the day while the timeout threshold is
 15
 minutes.
 So i dump the whole heapsize with the command  jmap
 -dump:live,format=b,file=3.dump.hprof processid
 and i truely get a 2G size dump files. I use SAP Memory Analyer
 to
   see
 what're stored in HeapMemory.
 and I found a strange number of Retained Heap usage:
 Classname
  ShallowHeap
   RetainHeap
   RetainedHeap%
 [EMAIL PROTECTED]
 16
 1,755,070,35287.64%
  [EMAIL PROTECTED]
 48 1,755,070,336
87.69%

 [EMAIL PROTECTED]
  ...
  33,554,448
  1,755,069,632   87.69%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
-
   [EMAIL PROTECTED]
...
24   3928
 0.00%
   + 2,863,659 more...

 Is that means that the Localizer Object used most of the heap
 size?
 or Is this number normal for Wicket App?

 I wonder whether I forget to release the memory by my mis-using
 of
i18n
 feature?
 Is there any attentions I must pay to when dealing with
 Localizer?

 This problem annoys me more the 2 weeks. I really need some
 help.
Thanks
 .



  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





   
--
View this message in context:
   
  
 
 http://www.nabble.com/Why-Localizer-Retained-so-many-heapsize--tp17142582p17199950.html
Sent from the Wicket - User 

hi, does anybody know, in wicket, how to make componete can be drap and drop

2008-05-14 Thread shrimpywu

hi, does anybody know, in wicket, how to make componete can be drap and drop

just like the ajax debug windows

-- 
View this message in context: 
http://www.nabble.com/hi%2C-does-anybody-know%2C-in-wicket%2C-how-to-make-componete-can-be-drap-and-drop-tp17230831p17230831.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hi, does anybody know, in wicket, how to make componete can be drap and drop

2008-05-14 Thread Martijn Dashorst
See scriptaculous integration on wicket-stuff. It has drag'n drop
capabilities, though I haven't used it myself. Probably
wicketstuff-yui, wicketstuff-jquery and wicketstuff-dojo have the same
capabilities.

Martijn

On 5/14/08, shrimpywu [EMAIL PROTECTED] wrote:

  hi, does anybody know, in wicket, how to make componete can be drap and drop

  just like the ajax debug windows


  --
  View this message in context: 
 http://www.nabble.com/hi%2C-does-anybody-know%2C-in-wicket%2C-how-to-make-componete-can-be-drap-and-drop-tp17230831p17230831.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread Eyal Golan
cool.
great stuff

On Wed, May 14, 2008 at 11:36 AM, lars vonk [EMAIL PROTECTED] wrote:

 Hi all,

 A new Wicket site is born! It's a Dutch site on which you can search for
 day
 trips and such. See: www.eropuit.nl.

 Thanks to the user- and dev-group for answering any questions we had during
 the process.

 Lars




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Quickstart broken for 1.4-m1

2008-05-14 Thread Erik van Oosten

Hi,

If I do:

mvn archetype:create -DarchetypeGroupId=org.apache.wicket 
-DarchetypeArtifactId=wicket-archetype-quickstart 
-DarchetypeVersion=1.4-m1 -DgroupId=nl.grons -DartifactId=i18ntest


as generated by the quickstart page 
(http://wicket.apache.org/quickstart.html), I get Wicket version 
1.3-SNAPSHOT in the pom. Of course that should be 1.4-m1.


Should I create a Jira issue?

Regards,
   Erik.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Quickstart broken for 1.4-m1

2008-05-14 Thread Martijn Dashorst
It is already fixed for 1.4-m2.

Martijn

On 5/14/08, Erik van Oosten [EMAIL PROTECTED] wrote:
 Hi,

  If I do:

  mvn archetype:create -DarchetypeGroupId=org.apache.wicket
 -DarchetypeArtifactId=wicket-archetype-quickstart
 -DarchetypeVersion=1.4-m1 -DgroupId=nl.grons -DartifactId=i18ntest

  as generated by the quickstart page
 (http://wicket.apache.org/quickstart.html), I get Wicket
 version 1.3-SNAPSHOT in the pom. Of course that should be 1.4-m1.

  Should I create a Jira issue?

  Regards,
Erik.


 -
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread Martijn Dashorst
Looks great!

Martijn

On 5/14/08, lars vonk [EMAIL PROTECTED] wrote:
 Hi all,

  A new Wicket site is born! It's a Dutch site on which you can search for day
  trips and such. See: www.eropuit.nl.

  Thanks to the user- and dev-group for answering any questions we had during
  the process.


  Lars



-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe

Let me outline what I believe the benefits are.  For example:

add(new LabelString(tournamentName, tournament.getName()));
add(new LabelString(hostName, game.getHostPlayer()));
row.add(new AttributeModifier(class, true, new
ModelString(row.getIndex() % 2 == 0 ? odd : even)));

add(new StringLabel(tournamentName, tournament.getName()));
add(new StringLabel(hostName, game.getHostPlayer()));
row.add(new AttributeModifier(class, true, new StringModel(row.getIndex()
% 2 == 0 ? odd : even)));

Sure, it seems like a small difference and a saving of two characters, but
here is what I believe are the benefits of doing this:

1) I can more easily use the features of my IDE such as auto-completion

2) Find Usages is more accurate (at least in IntelliJ, where I'm not aware
of a find-usages that scopes to a particular generic type)

3) Let's face it, Generics clutters up your code and makes it harder to
read.  This simplifies things a bit.

In answer to Martijn's assumption (in a separate post) that I was going to
iterate over all java types and all wicket types:  that is an incorrect
assumption.  Obviously, I would want to pick the most common use cases and
seek feedback from the community.  Let us not dismiss it outright.  I
believe this is a valid topic of conversation.  Generics are new to Wicket
and still unused by many Java APIs and likely new to many programmers.  I
can tell you that using classes such as this made it much quicker and easier
to remove all the warnings that showed up in my code when I migrated to 1.4. 
It seems easier to replace common usage from before (new Label(...)) with 
new StringLabel(...)  rather than new LabelString (even typing that now
was more difficult).  In any case, there may be some complaining about the
extensive use of Generics in 1.4 once it is released.  This may make it
easier to transition.  Maybe not.  At least let's be open to discussing it.

Finally, in answer to the point about negating the point of generics, I
respectfully disagree.  One major point of generics is to avoid code
duplication of boilerplate code.   It it weren't for the need to create
constructors, there wouldn't be any duplicated code.  I agree that it is a
fine balance to strike, but there are competing needs of readability and
maintainability.

-Doug


Hoover, William wrote:
 
 imho, that seems like that adds a lot of unnecessary code. One of the
 nice things about Wicket is that it keeps the bloat to a minimum.
 
 -Original Message-
 From: Doug Donohoe [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 14, 2008 8:21 AM
 To: users@wicket.apache.org
 Subject: Re: Using generics with some non-generic classes in Wicket
 
 
 Somewhat related to this thread, when I moved to generics win Wicket
 1.4,  I created some utility classes such as:
 
 public class VoidContainer extends WebMarkupContainerlt;Void public
 class VoidPanel extends Panellt;Void public class StringLabel extends
 Labellt;String
 
 public class IntegerModel extends Modellt;Integer public class
 StringModel extends Modellt;String public class DateModel extends
 Modellt;Date public class DoubleModel extends Modellt;Double
 
 And so on.  This made my wicket code cleaner and easier to use.  I think
 the Wicket 1.4 generics implementation is headed in the right direction.
 It was a pain at first because I had to parameterize everything, but
 creating convenience classes like this made it easier.
 
 I'm thinking about creating a patch with a suite of these types of
 classes because I think users will want something like this.
 
 -Doug
 
 
 Johan Compagner wrote:
 
 The problem is that wicket needs an annotation
 
 genericsOptional
 
 so that all the warnings about raw types are gone.
 
 A component only has to be generic if you use the IModel constructor 
 or call getModel(), getModelObject() methods..
 for the rest it is not really needed
 
 johan
 
 On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk 
 [EMAIL PROTECTED]
 wrote:
 
 My post kind of missed the point, I shouldn't post when I'm already 
 half asleep. :-)

 Obviously MarkupContainer satisfies the MarkupContainer? in a 
 method argument, so it accepts the raw type. However, it generates a 
 warning because the method says it's generified, so you should be 
 using the generic type.

 Johan Compagner wrote:

  I dont care, because i cant do any thing with the ? The only thing 
  it enforces is that it must now be a generic class which is 
  annoying. Not to mention that in that area eclipse and javac accept
 
  different things
 

 The reason it warns you to use generics when generics are wanted is 
 because Sun wants to be able to make it *required* (in a future 
 release) to use generics where generics are wanted; at least, so I 
 read... I think in the real world they wouldn't dare to do this 
 because it would piss off so many users and break so much stuff. :-)

 But the idea is that if something is generified you should be using a
 
 type parameter, and using a raw type 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl

 StringModel looks ambigious to me, will it extend

- LoadableDetachableModel
- IModel
- Model
- AbstractReadOnlyModel
- 

???




Am 14.05.2008 um 15:47 schrieb Doug Donohoe:



Let me outline what I believe the benefits are.  For example:

add(new LabelString(tournamentName, tournament.getName()));
add(new LabelString(hostName, game.getHostPlayer()));
row.add(new AttributeModifier(class, true, new
ModelString(row.getIndex() % 2 == 0 ? odd : even)));

add(new StringLabel(tournamentName, tournament.getName()));
add(new StringLabel(hostName, game.getHostPlayer()));
row.add(new AttributeModifier(class, true, new  
StringModel(row.getIndex()

% 2 == 0 ? odd : even)));

Sure, it seems like a small difference and a saving of two  
characters, but

here is what I believe are the benefits of doing this:

1) I can more easily use the features of my IDE such as auto- 
completion


2) Find Usages is more accurate (at least in IntelliJ, where I'm not  
aware

of a find-usages that scopes to a particular generic type)

3) Let's face it, Generics clutters up your code and makes it harder  
to

read.  This simplifies things a bit.

In answer to Martijn's assumption (in a separate post) that I was  
going to
iterate over all java types and all wicket types:  that is an  
incorrect
assumption.  Obviously, I would want to pick the most common use  
cases and

seek feedback from the community.  Let us not dismiss it outright.  I
believe this is a valid topic of conversation.  Generics are new to  
Wicket
and still unused by many Java APIs and likely new to many  
programmers.  I
can tell you that using classes such as this made it much quicker  
and easier
to remove all the warnings that showed up in my code when I migrated  
to 1.4.
It seems easier to replace common usage from before (new Label(...))  
with
new StringLabel(...)  rather than new LabelString (even typing  
that now
was more difficult).  In any case, there may be some complaining  
about the
extensive use of Generics in 1.4 once it is released.  This may make  
it
easier to transition.  Maybe not.  At least let's be open to  
discussing it.


Finally, in answer to the point about negating the point of  
generics, I

respectfully disagree.  One major point of generics is to avoid code
duplication of boilerplate code.   It it weren't for the need to  
create
constructors, there wouldn't be any duplicated code.  I agree that  
it is a
fine balance to strike, but there are competing needs of readability  
and

maintainability.

-Doug


Hoover, William wrote:


imho, that seems like that adds a lot of unnecessary code. One of the
nice things about Wicket is that it keeps the bloat to a minimum.

-Original Message-
From: Doug Donohoe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 8:21 AM
To: users@wicket.apache.org
Subject: Re: Using generics with some non-generic classes in Wicket


Somewhat related to this thread, when I moved to generics win Wicket
1.4,  I created some utility classes such as:

public class VoidContainer extends WebMarkupContainerlt;Void public
class VoidPanel extends Panellt;Void public class StringLabel  
extends

Labellt;String

public class IntegerModel extends Modellt;Integer public class
StringModel extends Modellt;String public class DateModel extends
Modellt;Date public class DoubleModel extends Modellt;Double

And so on.  This made my wicket code cleaner and easier to use.  I  
think
the Wicket 1.4 generics implementation is headed in the right  
direction.

It was a pain at first because I had to parameterize everything, but
creating convenience classes like this made it easier.

I'm thinking about creating a patch with a suite of these types of
classes because I think users will want something like this.

-Doug


Johan Compagner wrote:


The problem is that wicket needs an annotation

genericsOptional

so that all the warnings about raw types are gone.

A component only has to be generic if you use the IModel constructor
or call getModel(), getModelObject() methods..
for the rest it is not really needed

johan

On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk
[EMAIL PROTECTED]
wrote:


My post kind of missed the point, I shouldn't post when I'm already
half asleep. :-)

Obviously MarkupContainer satisfies the MarkupContainer? in a
method argument, so it accepts the raw type. However, it  
generates a

warning because the method says it's generified, so you should be
using the generic type.

Johan Compagner wrote:


I dont care, because i cant do any thing with the ? The only thing
it enforces is that it must now be a generic class which is
annoying. Not to mention that in that area eclipse and javac  
accept



different things



The reason it warns you to use generics when generics are wanted is
because Sun wants to be able to make it *required* (in a future
release) to use generics where generics are wanted; at least, so I
read... I think in the real world they wouldn't dare to do this
because it would 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Doug Donohoe

From my original post on this topic:

public class StringModel extends ModelString 

-Doug


Peter Ertl wrote:
 
   StringModel looks ambigious to me, will it extend
 
 - LoadableDetachableModel
 - IModel
 - Model
 - AbstractReadOnlyModel
 - 
 
 ???
 
 
 
 
 Am 14.05.2008 um 15:47 schrieb Doug Donohoe:
 

 Let me outline what I believe the benefits are.  For example:

 add(new LabelString(tournamentName, tournament.getName()));
 add(new LabelString(hostName, game.getHostPlayer()));
 row.add(new AttributeModifier(class, true, new
 ModelString(row.getIndex() % 2 == 0 ? odd : even)));

 add(new StringLabel(tournamentName, tournament.getName()));
 add(new StringLabel(hostName, game.getHostPlayer()));
 row.add(new AttributeModifier(class, true, new  
 StringModel(row.getIndex()
 % 2 == 0 ? odd : even)));

 Sure, it seems like a small difference and a saving of two  
 characters, but
 here is what I believe are the benefits of doing this:

 1) I can more easily use the features of my IDE such as auto- 
 completion

 2) Find Usages is more accurate (at least in IntelliJ, where I'm not  
 aware
 of a find-usages that scopes to a particular generic type)

 3) Let's face it, Generics clutters up your code and makes it harder  
 to
 read.  This simplifies things a bit.

 In answer to Martijn's assumption (in a separate post) that I was  
 going to
 iterate over all java types and all wicket types:  that is an  
 incorrect
 assumption.  Obviously, I would want to pick the most common use  
 cases and
 seek feedback from the community.  Let us not dismiss it outright.  I
 believe this is a valid topic of conversation.  Generics are new to  
 Wicket
 and still unused by many Java APIs and likely new to many  
 programmers.  I
 can tell you that using classes such as this made it much quicker  
 and easier
 to remove all the warnings that showed up in my code when I migrated  
 to 1.4.
 It seems easier to replace common usage from before (new Label(...))  
 with
 new StringLabel(...)  rather than new LabelString (even typing  
 that now
 was more difficult).  In any case, there may be some complaining  
 about the
 extensive use of Generics in 1.4 once it is released.  This may make  
 it
 easier to transition.  Maybe not.  At least let's be open to  
 discussing it.

 Finally, in answer to the point about negating the point of  
 generics, I
 respectfully disagree.  One major point of generics is to avoid code
 duplication of boilerplate code.   It it weren't for the need to  
 create
 constructors, there wouldn't be any duplicated code.  I agree that  
 it is a
 fine balance to strike, but there are competing needs of readability  
 and
 maintainability.

 -Doug


 Hoover, William wrote:

 imho, that seems like that adds a lot of unnecessary code. One of the
 nice things about Wicket is that it keeps the bloat to a minimum.

 -Original Message-
 From: Doug Donohoe [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 14, 2008 8:21 AM
 To: users@wicket.apache.org
 Subject: Re: Using generics with some non-generic classes in Wicket


 Somewhat related to this thread, when I moved to generics win Wicket
 1.4,  I created some utility classes such as:

 public class VoidContainer extends WebMarkupContainerlt;Void public
 class VoidPanel extends Panellt;Void public class StringLabel  
 extends
 Labellt;String

 public class IntegerModel extends Modellt;Integer public class
 StringModel extends Modellt;String public class DateModel extends
 Modellt;Date public class DoubleModel extends Modellt;Double

 And so on.  This made my wicket code cleaner and easier to use.  I  
 think
 the Wicket 1.4 generics implementation is headed in the right  
 direction.
 It was a pain at first because I had to parameterize everything, but
 creating convenience classes like this made it easier.

 I'm thinking about creating a patch with a suite of these types of
 classes because I think users will want something like this.

 -Doug


 Johan Compagner wrote:

 The problem is that wicket needs an annotation

 genericsOptional

 so that all the warnings about raw types are gone.

 A component only has to be generic if you use the IModel constructor
 or call getModel(), getModelObject() methods..
 for the rest it is not really needed

 johan

 On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk
 [EMAIL PROTECTED]
 wrote:

 My post kind of missed the point, I shouldn't post when I'm already
 half asleep. :-)

 Obviously MarkupContainer satisfies the MarkupContainer? in a
 method argument, so it accepts the raw type. However, it  
 generates a
 warning because the method says it's generified, so you should be
 using the generic type.

 Johan Compagner wrote:

 I dont care, because i cant do any thing with the ? The only thing
 it enforces is that it must now be a generic class which is
 annoying. Not to mention that in that area eclipse and javac  
 accept

 different things


 The reason it warns you to use generics when generics are 

Re: overriding getAssociatedMarkupStream

2008-05-14 Thread Igor Vaynberg
if you do not want the markup to be cached you have to also implement
IMarkupCacheKeyProvider. returning null from getcachekey will prevent
wicket from caching the markup.

-igor


On Wed, May 14, 2008 at 5:42 AM, Eyal Golan [EMAIL PROTECTED] wrote:
 Hi,
 I tried implementing the IMarkupResourceStreamProvider in my web page:
public IResourceStream getMarkupResourceStream(MarkupContainer
 container,
Class containerClass) {
if (html != null) {
StringResourceStream myhtml = new StringResourceStream(new
 StringBuilder(html));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
return m;
} else {
final DefaultMarkupResourceStreamProvider
 markupResourceStreamProvider =
new DefaultMarkupResourceStreamProvider();
return
 markupResourceStreamProvider.getMarkupResourceStream(container,
containerClass);
}
}

 (html is a class member that may or may not be available)

 It did not work:
 1. The Cache keeps the last html markup, so if I open this page once WITH
 html != null I get what I want (but with the same problem. look at next
 note). If then I open the page and the html  IS null, the cache returns the
 earlier page. So this approach is no good.

 2. In any case, HeaderContributers that are on components that in the page
 are not added to the output markup.

 Are the 2 lines:
StringResourceStream myhtml = new StringResourceStream(new
 StringBuilder(html));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
  The problem ?

 Thanks

 On Thu, May 8, 2008 at 6:41 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 you shouldnt be overriding that method, try implementing
 IMarkupResourceStreamProvider instead.

 -igor


 On Tue, May 6, 2008 at 11:20 PM, Eyal Golan [EMAIL PROTECTED] wrote:
  ok, maybe I wasn't clear enough.
   The simple question is, why the add(HeaderContributor.forCss...));
   is not added to the output markup when I override
 getAssociatedMarkupStream?
 
   Thanks
 
 
 
   On Tue, May 6, 2008 at 4:08 PM, Eyal Golan [EMAIL PROTECTED] wrote:
 
Hi all,
We have this method:
@Override
public MarkupStream getAssociatedMarkupStream(final boolean
throwException)
{
if(html != null) {
return GUIUtis.getMarkupStream(this, html);
}
return super.getAssociatedMarkupStream(throwException);
}
   
and:
static public MarkupStream getMarkupStream(Page page,String
 htmlText){
try
{
StringResourceStream myhtml = new StringResourceStream(new
StringBuilder(htmlText));
MarkupResourceStream m = new MarkupResourceStream(myhtml);
Markup myMarkup =
   
 page.getApplication().getMarkupSettings().getMarkupParserFactory().newMarkupParser(m).parse();
MarkupStream markupStream = new MarkupStream(myMarkup);
return markupStream;
}
catch (Exception ex)
{
throw new RuntimeException(Fail to parse
markup:\n+htmlText);
}
}
   
The problem:
When the html is not null (and we enter GUIUtis.getMarkupStream),
css that where added using HeaderContributer are not added to the
 output
HTML markup.
I have something like this in a component:
add(HeaderContributor.forCss(EurekifyButton.class,
 EurekifyButton.css));
The css is missing.
   
I can't change the usage of getAssociatedMarkupStream to use variation
 or
something like this.
   
any thought?
--
Eyal Golan
[EMAIL PROTECTED]
   
Visit: http://jvdrums.sourceforge.net/
 
 
 
 
   --
   Eyal Golan
   [EMAIL PROTECTED]
 
   Visit: http://jvdrums.sourceforge.net/
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 Eyal Golan
 [EMAIL PROTECTED]

 Visit: http://jvdrums.sourceforge.net/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Stefan Simik

Great, it work without warnings now ;)

Joham, could you please change the following class too ?

file: Loop.java
line:53
from:   LoopItem extends WebMarkupContainer
to:  LoopItem extends WebMarkupContainerInteger

thx ;)
Stefan




Johan Compagner wrote:
 
 i already did the commit just yet..
 
 i did make them all   because i think people generally dont want to
 generify them anyway (use the model object)
 
 
 
 On Tue, May 13, 2008 at 9:48 PM, Stefan Simik [EMAIL PROTECTED]
 wrote:
 

 please, and will be these classes later generified ?
 Or should I make a RFE, or can I help anyway-for example attach a patch ?

 I love your work and Wicket, so I do my best, to make it better ;)

 Stefan Simik






 Johan Compagner wrote:
 
  yes thats the reason
 
  you are calling the method add with a generified component but that
  container itself is not generified
 
  i dont like this about generics expecially the onces like this:
 
  add(MarkupContainer? container)
 
  then suddenly a none generified component cant be added...
  thats really stupid ? should mean anything.. including none generics
 
  johan
 
 
  On Tue, May 13, 2008 at 5:55 PM, Stefan Simik [EMAIL PROTECTED]
  wrote:
 
 
  I have one idea,
 
  the reason of the warnigs is, that parent of AjaxPagingNavigator is
  PagingNavigator,
  which has parent Panel --- that is not parameterized.
 
  The same problem is with LoopItem, which extends the
  WebMarkupContainer --- that is not parameterized.
 
  ? could this be the reason ?
 
 
 
 
 
 
  Stefan Simik wrote:
  
   Mhmm, it is meaningful ;) I will know in future, thx
  
   One of the last occuring warning is, when working with
   MarkupContainer#add(...)  or  #addOrReplace(...)  method.
  
   Example:  I have a simple AjaxPagingNavigator, to which I add a
 simple
   ListView
  
 ---
   ListViewInteger menu = new ListViewInteger(id, numbers){
   //populate metods
   }
   add(menu);//warning here
  
   The warning says:
   Type safety: The method add(Component...) belongs to the raw type
   MarkupContainer.
   References to generic type MarkupContainerT should be
 parameterized
  
   I cannot find out, what's the warning reason, because ListView self
 is
   parameterized.
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17216869.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17233011.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



WicketStuff Dojo Tooltip - Question

2008-05-14 Thread Patel, Sanjay
I used WicketStuff Dojo Tooltip in my one page and it works fine. Right
now the tooltip displays on mouseover event. Is there anyway I can
display it on onClick event?

On my other page I have a link which I am hiding/showing through ajax
update (target.addComponent(..)) based on some condition. In this case
the tooltip is not being displayed.
Do I need to do anything else for that? Please see code below.
-
JAVA Code
final Label myLinkComponent= new Label(link,
objectiveDescLabelModel) {

public boolean isVisible() {
return true or false based on
condition;
}
};
final MyPanel myPanel = new MyPanel (panel-id,
objectiveDescLabelModel, new LoadableDetachableModel() {
private static final long serialVersionUID = 1L;

protected final Object load() {
return Dynamic Tooltip;
}

});
DojoTooltip tooltip = new DojoTooltip(tooltip,
myLinkComponent);
tooltip.add(myPanel);
...
add(myLinkComponent);
add(tooltip);
-
HTML Code
a wicket:id=link href=javascript:void(0);/a
span wicket:id=tooltipspan
wicket:id=panel-id/span/span


Thanks,
Sanjay Patel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wrong page is rendered

2008-05-14 Thread Minto van der Sluis

Hi folks,

Being in the process of adding a wicket based administration console to an
existing struts based application, I have been able to set up some simple
pages. Unittesting these pages works fines. Also using 'mvn jetty:run'
starts the wicket based part just fine. I can click through the application
and everything works as expected.

However when I integrate (using mvn war overlay) the wicket part inside the
existing struts application something weird is happening. I can bring up de
first page (homepage) in the wicket based administration console.
Unfortunately the links to other wicket based pages only result in a refresh
of the homepage.

I wonder if this behaviour has something to do with how I added the
administration console to the existing web application. Here are the
snippets of what I have added to my web.xml.

  ... snip ...
  
filter
filter-namewicket.bvh-console/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name

param-valuenl.politie.bvh.console.WicketApplication/param-value
/init-param
/filter

filter-mapping
filter-namewicket.bvh-console/filter-name
url-pattern/console/*/url-pattern
/filter-mapping

  ... snap ...

On the initially rendered homepage a link to other pages look like this.

  ...
  li
button type=submit wicket:id=email onclick=var win =
this.ownerDocument.defaultView || this.ownerDocument.parentWindow; if (win
== window) {
window.location.href='?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage';
} ;return false
  Email host
/button
  /li
  ...

So in short using 'mvn jetty:run' and trying the following link gives me the
expected results.

 
http://localhost:8080/bvh-console/?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage
  
When locally deploying my app I expected the following link to work as well.
Unfortunately I ended up with the configured homepage, which is a different
page.

 
http://localhost:/avi/console/?wicket:bookmarkablePage=%3Anl.politie.bvh.console.koppelingen.EmailPage

To me it seems like I missed something, but I can't figure out what. Any
help is greatly appreciated.

I am btw using wicket version 1.3.1

Kind regards,

Minto van der Sluis

-- 
View this message in context: 
http://www.nabble.com/Wrong-page-is-rendered-tp17233259p17233259.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Quan Zhou
Yes , it would be a bit slower. I'm going to make more test to see what
havn't store in cache.
Maybe i can caculate how many percents it effect my application performance
after i deploy it in a high load circumstance.

I'm not sure about what you said about your fix for not including page.
can you make it some clear? thanks very much.


2008/5/14 Johan Compagner [EMAIL PROTECTED]:

 ok so you dont store the tested cacheKey 's that returned null..
 so that could result in a bit slower access because it is tried to resolve
 everytime

 I do think that my fix for not including the page is solving your real mem
 leak problem

 johan


 On Wed, May 14, 2008 at 2:03 PM, Quan Zhou [EMAIL PROTECTED] wrote:

getResourceSettings().setLocalizer(new Localizer() {
 @Override
 public void putIntoCache(final String cacheKey,final String
  string) {
 if (string != null  cacheKey!=null)
 super.putIntoCache(cacheKey, string);
 }
 });
 
 
 
  2008/5/14 Johan Compagner [EMAIL PROTECTED]:
 
   but what did you do there in that method?
   nothing? you dont cache anything anymore?
  
   On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED]
  wrote:
  
Hello everyone.
   
I override Localizer.putIntoCache method. and it really reduce the
heapsize
usage of Localizer.
   
The application is more stable now although the key remains large.
   
Hope we can find a way to shorter the key length.
   
thanks everyone.
   
2008/5/13 Eirik Rude [EMAIL PROTECTED]:
   

 A soft reference is very common for this type of thing.  I know
 some
  of
 ICU's
 resources are stored this way.



 Jonathan Locke wrote:
 
 
  maybe localizer should limit its size or use a soft reference
  cache?
 
 
  Johan Compagner wrote:
 
  Can you really see what it holds?
  Almost 2G in memory in localizer is extreme... Thats really a
 lot
  of
  strings..
  You could try to read that dump with yourkit if your current one
  doesnt show enough.
 
  On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
  Hello everyone.
 
  I recently develop my App use Wicket1.3.3. It's my first time
 to
   use
  this
  framework and I feel it's really really a perfect framework for
  me.
  My app support both Simplified Chinese , Traditional Chinese, I
  implement
  this with Wicket i18n feature.
  With the load increasing these days, I found my app would
 become
very
  lag
  abount every 24 hours ,so that i would only restart it
  without any choice.
  when I found the lag, My log records many Exceptions like :
  after 1 minute the Pagemap null is still locked by:
  Thread[http-8080-321,5,main], giving
  up trying to get the page for path xxx
 
  I check the JVM status with jstat -gc , It tells that the
  Heapsize
is
  full
  even after full GC.
  My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
  -XX:MaxPermSize=250m
  My deploy server has 2*CPU and 4G memory, Redhat AS4 OS +
 tomcat
6.0.
  There're 2000 sessions on the day while the timeout threshold
 is
  15
  minutes.
  So i dump the whole heapsize with the command  jmap
  -dump:live,format=b,file=3.dump.hprof processid
  and i truely get a 2G size dump files. I use SAP Memory Analyer
  to
see
  what're stored in HeapMemory.
  and I found a strange number of Retained Heap usage:
  Classname
   ShallowHeap
RetainHeap
RetainedHeap%
  [EMAIL PROTECTED]
  16
  1,755,070,35287.64%
   [EMAIL PROTECTED]
  48 1,755,070,336
 87.69%
 
  [EMAIL PROTECTED]
   ...
   33,554,448
   1,755,069,632   87.69%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
 -
[EMAIL PROTECTED]
 ...
 24   3928
  0.00%
+ 2,863,659 more...
 
  Is that means that the Localizer Object used most of the heap
  size?
  or Is this number normal for Wicket App?
 
  I wonder whether I forget to release the memory by my mis-using
  of
 i18n
  feature?
  Is there 

Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Johan Compagner
i fixed something in the localizer that it doesnt add the page id to the
cachekey string
that was your problem
everypage that was created also creates an localizer entry that is just
plain wrong.

So the pageid is not in the path anymore.. i think this is what really
caused your constant growing cache


On Wed, May 14, 2008 at 5:04 PM, Quan Zhou [EMAIL PROTECTED] wrote:

 Yes , it would be a bit slower. I'm going to make more test to see what
 havn't store in cache.
 Maybe i can caculate how many percents it effect my application performance
 after i deploy it in a high load circumstance.

 I'm not sure about what you said about your fix for not including page.
 can you make it some clear? thanks very much.


 2008/5/14 Johan Compagner [EMAIL PROTECTED]:

  ok so you dont store the tested cacheKey 's that returned null..
  so that could result in a bit slower access because it is tried to
 resolve
  everytime
 
  I do think that my fix for not including the page is solving your real
 mem
  leak problem
 
  johan
 
 
  On Wed, May 14, 2008 at 2:03 PM, Quan Zhou [EMAIL PROTECTED] wrote:
 
 getResourceSettings().setLocalizer(new Localizer() {
  @Override
  public void putIntoCache(final String cacheKey,final String
   string) {
  if (string != null  cacheKey!=null)
  super.putIntoCache(cacheKey, string);
  }
  });
  
  
  
   2008/5/14 Johan Compagner [EMAIL PROTECTED]:
  
but what did you do there in that method?
nothing? you dont cache anything anymore?
   
On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED]
   wrote:
   
 Hello everyone.

 I override Localizer.putIntoCache method. and it really reduce the
 heapsize
 usage of Localizer.

 The application is more stable now although the key remains large.

 Hope we can find a way to shorter the key length.

 thanks everyone.

 2008/5/13 Eirik Rude [EMAIL PROTECTED]:

 
  A soft reference is very common for this type of thing.  I know
  some
   of
  ICU's
  resources are stored this way.
 
 
 
  Jonathan Locke wrote:
  
  
   maybe localizer should limit its size or use a soft reference
   cache?
  
  
   Johan Compagner wrote:
  
   Can you really see what it holds?
   Almost 2G in memory in localizer is extreme... Thats really a
  lot
   of
   strings..
   You could try to read that dump with yourkit if your current
 one
   doesnt show enough.
  
   On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
   Hello everyone.
  
   I recently develop my App use Wicket1.3.3. It's my first time
  to
use
   this
   framework and I feel it's really really a perfect framework
 for
   me.
   My app support both Simplified Chinese , Traditional Chinese,
 I
   implement
   this with Wicket i18n feature.
   With the load increasing these days, I found my app would
  become
 very
   lag
   abount every 24 hours ,so that i would only restart it
   without any choice.
   when I found the lag, My log records many Exceptions like :
   after 1 minute the Pagemap null is still locked by:
   Thread[http-8080-321,5,main], giving
   up trying to get the page for path xxx
  
   I check the JVM status with jstat -gc , It tells that the
   Heapsize
 is
   full
   even after full GC.
   My VM paraemter is -Xms2000m -Xmx2000m -XX:MaxNewSize=250m
   -XX:MaxPermSize=250m
   My deploy server has 2*CPU and 4G memory, Redhat AS4 OS +
  tomcat
 6.0.
   There're 2000 sessions on the day while the timeout threshold
  is
   15
   minutes.
   So i dump the whole heapsize with the command  jmap
   -dump:live,format=b,file=3.dump.hprof processid
   and i truely get a 2G size dump files. I use SAP Memory
 Analyer
   to
 see
   what're stored in HeapMemory.
   and I found a strange number of Retained Heap usage:
   Classname
ShallowHeap
 RetainHeap
 RetainedHeap%
   [EMAIL PROTECTED]
   16
   1,755,070,35287.64%
[EMAIL PROTECTED]
 ..
   48 1,755,070,336
  87.69%
  
   [EMAIL PROTECTED]
...
33,554,448
1,755,069,632
 87.69%
  -
 [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -
 [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -
 [EMAIL PROTECTED]
  ...
  24   3928
   0.00%
  -
 [EMAIL PROTECTED]
  ...
  24   3928
 

Re: Processing a form before page components are created

2008-05-14 Thread Joel Halbert
What about the situation where one of the components on the Page is a 
BookmarkeablePageLink and you need to pass it in some PageParameters? In 
this case how do you load the page parameters from the model in a lazy 
fashion? It doesn't appear to be possible since PageParameters does not 
evaluate against a model, thus the values need to be supplied upfront, while 
the page is being created...


--
From: Joel Halbert [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 12:57 PM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created


I take your point, thanks for the pointer.

--
From: Eelco Hillenius [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 1:31 AM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created

 The reason I want to do this is that my pages are stateless, and I want 
to

process the submitted form before all the components on the page are
initialised, incase I need to load different data models, or redirect 
the

request to another page, thus saving unnecessary database calls and
component initialisation.

 At the moment what I am doing is processing the form by directly 
reading
the page parameters in the constructor before I add any components to 
the

page, and then redirecting the request or initializing the page as
appropriate (bypassing the use of Form.onSubmit).


If you make sure your models/ components work lazily you can avoid
database calls being done until the components are actually rendered.
Rendering is a separate phase executing after component construction
and form handling. And you can let your form just populate a simple
bean to avoid database access. I wouldn't worry about the creation of
a few components, and you can break of any time with a
RestartResponseException or set the next page (without breaking off
current processing) using setResponsePage.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Processing a form before page components are created

2008-05-14 Thread Joel Halbert

unless, i suppose, if you override getPageParameters, something like this:

private void getLinkToUserProfile(final RatingModel r) {
return new BookmarkablePageLink(username, ViewDetails.class) {
@Override
public PageParameters getPageParameters() {
PageParameters pp = new PageParameters();
pp.put(Params.userId.toString(), 
r.getRating().getUserId());
return pp;
}

};
}

--
From: Joel Halbert [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 4:21 PM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created

What about the situation where one of the components on the Page is a 
BookmarkeablePageLink and you need to pass it in some PageParameters? In 
this case how do you load the page parameters from the model in a lazy 
fashion? It doesn't appear to be possible since PageParameters does not 
evaluate against a model, thus the values need to be supplied upfront, 
while the page is being created...


--
From: Joel Halbert [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 12:57 PM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created


I take your point, thanks for the pointer.

--
From: Eelco Hillenius [EMAIL PROTECTED]
Sent: Wednesday, May 14, 2008 1:31 AM
To: users@wicket.apache.org
Subject: Re: Processing a form before page components are created

 The reason I want to do this is that my pages are stateless, and I 
want to

process the submitted form before all the components on the page are
initialised, incase I need to load different data models, or redirect 
the

request to another page, thus saving unnecessary database calls and
component initialisation.

 At the moment what I am doing is processing the form by directly 
reading
the page parameters in the constructor before I add any components to 
the

page, and then redirecting the request or initializing the page as
appropriate (bypassing the use of Form.onSubmit).


If you make sure your models/ components work lazily you can avoid
database calls being done until the components are actually rendered.
Rendering is a separate phase executing after component construction
and form handling. And you can let your form just populate a simple
bean to avoid database access. I wouldn't worry about the creation of
a few components, and you can break of any time with a
RestartResponseException or set the next page (without breaking off
current processing) using setResponsePage.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
hmm i will make it Void
because the LoopItem doesnt really have a model with an Integer in the
model..
it has an primitive int itself stored in it self.

johan


On Wed, May 14, 2008 at 4:52 PM, Stefan Simik [EMAIL PROTECTED]
wrote:


 Great, it work without warnings now ;)

 Joham, could you please change the following class too ?

 file: Loop.java
 line:53
 from:   LoopItem extends WebMarkupContainer
 to:  LoopItem extends WebMarkupContainerInteger

 thx ;)
 Stefan




 Johan Compagner wrote:
 
  i already did the commit just yet..
 
  i did make them all   because i think people generally dont want to
  generify them anyway (use the model object)
 
 
 
  On Tue, May 13, 2008 at 9:48 PM, Stefan Simik [EMAIL PROTECTED]
  wrote:
 
 
  please, and will be these classes later generified ?
  Or should I make a RFE, or can I help anyway-for example attach a patch
 ?
 
  I love your work and Wicket, so I do my best, to make it better ;)
 
  Stefan Simik
 
 
 
 
 
 
  Johan Compagner wrote:
  
   yes thats the reason
  
   you are calling the method add with a generified component but that
   container itself is not generified
  
   i dont like this about generics expecially the onces like this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none generics
  
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik [EMAIL PROTECTED]
 
   wrote:
  
  
   I have one idea,
  
   the reason of the warnigs is, that parent of AjaxPagingNavigator is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
   
Mhmm, it is meaningful ;) I will know in future, thx
   
One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.
   
Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
ListView
   
  ---
ListViewInteger menu = new ListViewInteger(id, numbers){
//populate metods
}
add(menu);//warning here
   
The warning says:
Type safety: The method add(Component...) belongs to the raw type
MarkupContainer.
References to generic type MarkupContainerT should be
  parameterized
   
I cannot find out, what's the warning reason, because ListView self
  is
parameterized.
   
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17216869.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17233011.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
and that is the whole problem
who needs the Model itself as a string?
many are dynamic with getObject() impl.
then you shouldnt really do Model but IModel directly

johan


On Wed, May 14, 2008 at 4:29 PM, Doug Donohoe [EMAIL PROTECTED] wrote:


 From my original post on this topic:

 public class StringModel extends ModelString

 -Doug


 Peter Ertl wrote:
 
StringModel looks ambigious to me, will it extend
 
  - LoadableDetachableModel
  - IModel
  - Model
  - AbstractReadOnlyModel
  - 
 
  ???
 
 
 
 
  Am 14.05.2008 um 15:47 schrieb Doug Donohoe:
 
 
  Let me outline what I believe the benefits are.  For example:
 
  add(new LabelString(tournamentName, tournament.getName()));
  add(new LabelString(hostName, game.getHostPlayer()));
  row.add(new AttributeModifier(class, true, new
  ModelString(row.getIndex() % 2 == 0 ? odd : even)));
 
  add(new StringLabel(tournamentName, tournament.getName()));
  add(new StringLabel(hostName, game.getHostPlayer()));
  row.add(new AttributeModifier(class, true, new
  StringModel(row.getIndex()
  % 2 == 0 ? odd : even)));
 
  Sure, it seems like a small difference and a saving of two
  characters, but
  here is what I believe are the benefits of doing this:
 
  1) I can more easily use the features of my IDE such as auto-
  completion
 
  2) Find Usages is more accurate (at least in IntelliJ, where I'm not
  aware
  of a find-usages that scopes to a particular generic type)
 
  3) Let's face it, Generics clutters up your code and makes it harder
  to
  read.  This simplifies things a bit.
 
  In answer to Martijn's assumption (in a separate post) that I was
  going to
  iterate over all java types and all wicket types:  that is an
  incorrect
  assumption.  Obviously, I would want to pick the most common use
  cases and
  seek feedback from the community.  Let us not dismiss it outright.  I
  believe this is a valid topic of conversation.  Generics are new to
  Wicket
  and still unused by many Java APIs and likely new to many
  programmers.  I
  can tell you that using classes such as this made it much quicker
  and easier
  to remove all the warnings that showed up in my code when I migrated
  to 1.4.
  It seems easier to replace common usage from before (new Label(...))
  with
  new StringLabel(...)  rather than new LabelString (even typing
  that now
  was more difficult).  In any case, there may be some complaining
  about the
  extensive use of Generics in 1.4 once it is released.  This may make
  it
  easier to transition.  Maybe not.  At least let's be open to
  discussing it.
 
  Finally, in answer to the point about negating the point of
  generics, I
  respectfully disagree.  One major point of generics is to avoid code
  duplication of boilerplate code.   It it weren't for the need to
  create
  constructors, there wouldn't be any duplicated code.  I agree that
  it is a
  fine balance to strike, but there are competing needs of readability
  and
  maintainability.
 
  -Doug
 
 
  Hoover, William wrote:
 
  imho, that seems like that adds a lot of unnecessary code. One of the
  nice things about Wicket is that it keeps the bloat to a minimum.
 
  -Original Message-
  From: Doug Donohoe [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, May 14, 2008 8:21 AM
  To: users@wicket.apache.org
  Subject: Re: Using generics with some non-generic classes in Wicket
 
 
  Somewhat related to this thread, when I moved to generics win Wicket
  1.4,  I created some utility classes such as:
 
  public class VoidContainer extends WebMarkupContainerlt;Void public
  class VoidPanel extends Panellt;Void public class StringLabel
  extends
  Labellt;String
 
  public class IntegerModel extends Modellt;Integer public class
  StringModel extends Modellt;String public class DateModel extends
  Modellt;Date public class DoubleModel extends Modellt;Double
 
  And so on.  This made my wicket code cleaner and easier to use.  I
  think
  the Wicket 1.4 generics implementation is headed in the right
  direction.
  It was a pain at first because I had to parameterize everything, but
  creating convenience classes like this made it easier.
 
  I'm thinking about creating a patch with a suite of these types of
  classes because I think users will want something like this.
 
  -Doug
 
 
  Johan Compagner wrote:
 
  The problem is that wicket needs an annotation
 
  genericsOptional
 
  so that all the warnings about raw types are gone.
 
  A component only has to be generic if you use the IModel constructor
  or call getModel(), getModelObject() methods..
  for the rest it is not really needed
 
  johan
 
  On Wed, May 14, 2008 at 9:28 AM, Sebastiaan van Erk
  [EMAIL PROTECTED]
  wrote:
 
  My post kind of missed the point, I shouldn't post when I'm already
  half asleep. :-)
 
  Obviously MarkupContainer satisfies the MarkupContainer? in a
  method argument, so it accepts the raw type. However, it
  generates a
  warning because the method says it's generified, so you should be
  

Re: A question about IHeaderContributor

2008-05-14 Thread Johan Compagner
as long as eelco wants to fix it i dont mind

On Wed, May 14, 2008 at 9:59 AM, Gerolf Seitz [EMAIL PROTECTED]
wrote:

 On Wed, May 14, 2008 at 2:33 AM, Eelco Hillenius 
 [EMAIL PROTECTED]
 wrote:

  If you think it is a bug, please open a JIRA
  issue for it.


 didn't we EOL Wicket 1.2.x?

 http://martijndashorst.com/blog/2008/03/23/wicket-127-the-last-maintenance-release/

  Gerolf



AutoComplete enter key behavior

2008-05-14 Thread Ricky
Hi,

I am trying to add a behavior to my autoComplete text field, where if i
press enter, it should be able to run a default search (with some text
input) and display a list of possible choices);

is it possible with autoComplete.add(new AjaxBehavior() {
   @Override
public void onEvent() { }
} );

 or some other additional component ?

Any help would be appreciable.
Rick


Re: FYI: new wicket site

2008-05-14 Thread Frank Bille
Very nice! But where is the Powered by Apache Wicket button?

Frank

On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
 Hi all,

 A new Wicket site is born! It's a Dutch site on which you can search for day
 trips and such. See: www.eropuit.nl.

 Thanks to the user- and dev-group for answering any questions we had during
 the process.

 Lars


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread Eelco Hillenius
 A new Wicket site is born! It's a Dutch site on which you can search for day
 trips and such. See: www.eropuit.nl.

Nice. I like the 'history of Ajax' event. So soon ;-)

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A question about IHeaderContributor

2008-05-14 Thread Eelco Hillenius
 If you think it is a bug, please open a JIRA
 issue for it.


 didn't we EOL Wicket 1.2.x?
 http://martijndashorst.com/blog/2008/03/23/wicket-127-the-last-maintenance-release/

Yeah, I actually meant for Wicket 1.3 and up, because the bug is in
there as well.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoComplete enter key behavior

2008-05-14 Thread richardwilko

Hi,

We have changed our auto complete so that when you press enter on one of the
choices in the drop down we submit the form (default is to just populate the
box), is this what you mean?  unfortunatly to do this you need to hack the
wicket-autocomplete.js at the point where the enter key is pressed and ad
some manual javascript to do what you want.

Richard




Ricky-22 wrote:
 
 Hi,
 
 I am trying to add a behavior to my autoComplete text field, where if i
 press enter, it should be able to run a default search (with some text
 input) and display a list of possible choices);
 
 is it possible with autoComplete.add(new AjaxBehavior() {
@Override
 public void onEvent() { }
 } );
 
  or some other additional component ?
 
 Any help would be appreciable.
 Rick
 
 

-- 
View this message in context: 
http://www.nabble.com/AutoComplete-%22enter%22-key-behavior-tp17234468p17235509.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Processing a form before page components are created

2008-05-14 Thread Eelco Hillenius
On Wed, May 14, 2008 at 8:21 AM, Joel Halbert [EMAIL PROTECTED] wrote:
 What about the situation where one of the components on the Page is a
 BookmarkeablePageLink and you need to pass it in some PageParameters? In
 this case how do you load the page parameters from the model in a lazy
 fashion? It doesn't appear to be possible since PageParameters does not
 evaluate against a model, thus the values need to be supplied upfront, while
 the page is being created...

But you don't have to load the page parameters lazily, right?

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Processing a form before page components are created

2008-05-14 Thread Eelco Hillenius
On Wed, May 14, 2008 at 8:24 AM, Joel Halbert [EMAIL PROTECTED] wrote:
 unless, i suppose, if you override getPageParameters, something like this:

private void getLinkToUserProfile(final RatingModel r) {
return new BookmarkablePageLink(username,
 ViewDetails.class) {
@Override
public PageParameters getPageParameters() {
PageParameters pp = new PageParameters();
pp.put(Params.userId.toString(),
 r.getRating().getUserId());
return pp;
}

};
}

Right, something like that.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
so why dont we store the integer in the model then? save an extra
memory slot, because if you make it Void then no one can set the
modelobject anyways.

-igor

On Wed, May 14, 2008 at 8:28 AM, Johan Compagner [EMAIL PROTECTED] wrote:
 hmm i will make it Void
 because the LoopItem doesnt really have a model with an Integer in the
 model..
 it has an primitive int itself stored in it self.

 johan


 On Wed, May 14, 2008 at 4:52 PM, Stefan Simik [EMAIL PROTECTED]
 wrote:


 Great, it work without warnings now ;)

 Joham, could you please change the following class too ?

 file: Loop.java
 line:53
 from:   LoopItem extends WebMarkupContainer
 to:  LoopItem extends WebMarkupContainerInteger

 thx ;)
 Stefan




 Johan Compagner wrote:
 
  i already did the commit just yet..
 
  i did make them all   because i think people generally dont want to
  generify them anyway (use the model object)
 
 
 
  On Tue, May 13, 2008 at 9:48 PM, Stefan Simik [EMAIL PROTECTED]
  wrote:
 
 
  please, and will be these classes later generified ?
  Or should I make a RFE, or can I help anyway-for example attach a patch
 ?
 
  I love your work and Wicket, so I do my best, to make it better ;)
 
  Stefan Simik
 
 
 
 
 
 
  Johan Compagner wrote:
  
   yes thats the reason
  
   you are calling the method add with a generified component but that
   container itself is not generified
  
   i dont like this about generics expecially the onces like this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none generics
  
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik [EMAIL PROTECTED]
 
   wrote:
  
  
   I have one idea,
  
   the reason of the warnigs is, that parent of AjaxPagingNavigator is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
   
Mhmm, it is meaningful ;) I will know in future, thx
   
One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.
   
Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
ListView
   
  ---
ListViewInteger menu = new ListViewInteger(id, numbers){
//populate metods
}
add(menu);//warning here
   
The warning says:
Type safety: The method add(Component...) belongs to the raw type
MarkupContainer.
References to generic type MarkupContainerT should be
  parameterized
   
I cannot find out, what's the warning reason, because ListView self
  is
parameterized.
   
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17216869.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17233011.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
That would cost more memory then it would gain

Now it is just 1 int field.. And do know that model isnt a field any
more by itself on component. Ok it is still a reference but that is
shared by behaviours and metadata.

So if we set it in a model, we would have created the model object
with a reference to a created Integer object that has the int value...
And that is stored in component, now if there is no metadata or
behavior then that cost nothing but if there was then everything cost
more..

On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 so why dont we store the integer in the model then? save an extra
 memory slot, because if you make it Void then no one can set the
 modelobject anyways.

 -igor

 On Wed, May 14, 2008 at 8:28 AM, Johan Compagner [EMAIL PROTECTED]
 wrote:
 hmm i will make it Void
 because the LoopItem doesnt really have a model with an Integer in the
 model..
 it has an primitive int itself stored in it self.

 johan


 On Wed, May 14, 2008 at 4:52 PM, Stefan Simik [EMAIL PROTECTED]
 wrote:


 Great, it work without warnings now ;)

 Joham, could you please change the following class too ?

 file: Loop.java
 line:53
 from:   LoopItem extends WebMarkupContainer
 to:  LoopItem extends WebMarkupContainerInteger

 thx ;)
 Stefan




 Johan Compagner wrote:
 
  i already did the commit just yet..
 
  i did make them all   because i think people generally dont want to
  generify them anyway (use the model object)
 
 
 
  On Tue, May 13, 2008 at 9:48 PM, Stefan Simik [EMAIL PROTECTED]
  wrote:
 
 
  please, and will be these classes later generified ?
  Or should I make a RFE, or can I help anyway-for example attach a
  patch
 ?
 
  I love your work and Wicket, so I do my best, to make it better ;)
 
  Stefan Simik
 
 
 
 
 
 
  Johan Compagner wrote:
  
   yes thats the reason
  
   you are calling the method add with a generified component but that
   container itself is not generified
  
   i dont like this about generics expecially the onces like this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none
   generics
  
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
   [EMAIL PROTECTED]
 
   wrote:
  
  
   I have one idea,
  
   the reason of the warnigs is, that parent of AjaxPagingNavigator is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
   
Mhmm, it is meaningful ;) I will know in future, thx
   
One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.
   
Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
ListView
   
  ---
ListViewInteger menu = new ListViewInteger(id, numbers){
//populate metods
}
add(menu);//warning here
   
The warning says:
Type safety: The method add(Component...) belongs to the raw
type
MarkupContainer.
References to generic type MarkupContainerT should be
  parameterized
   
I cannot find out, what's the warning reason, because ListView
self
  is
parameterized.
   
   
  
   --
   View this message in context:
  
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
 
  --
  View this message in context:
 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17216869.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-1.4M1-tp17208928p17233011.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoComplete enter key behavior

2008-05-14 Thread Ricky
Hi,
Thanks for reply. I meant right now, there is an onChange event behavior
attached to the autocomplete, which allows me to type in the text box and
the list of possible matched choices appear; but what i also want is that
when i press enter on the text box, it should give me list of choices
(taking in some input search string).

Is that possible without adding any additional java script ?

Rick

On Wed, May 14, 2008 at 12:40 PM, richardwilko 
[EMAIL PROTECTED] wrote:


 Hi,

 We have changed our auto complete so that when you press enter on one of
 the
 choices in the drop down we submit the form (default is to just populate
 the
 box), is this what you mean?  unfortunatly to do this you need to hack the
 wicket-autocomplete.js at the point where the enter key is pressed and ad
 some manual javascript to do what you want.

 Richard




 Ricky-22 wrote:
 
  Hi,
 
  I am trying to add a behavior to my autoComplete text field, where if i
  press enter, it should be able to run a default search (with some text
  input) and display a list of possible choices);
 
  is it possible with autoComplete.add(new AjaxBehavior() {
 @Override
  public void onEvent() { }
  } );
 
   or some other additional component ?
 
  Any help would be appreciable.
  Rick
 
 

 --
 View this message in context:
 http://www.nabble.com/AutoComplete-%22enter%22-key-behavior-tp17234468p17235509.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 

Regards
Vyas, Anirudh
||  ॐ  ||


Re: Wicket play nicely with GWT

2008-05-14 Thread Brill Pappin
passing generated data in and out of GWT that doesn't come from the
RPC is a bit messy... there are a few ways to do it, but you really
want to avoid trying to do that unless GWT initiates the call.

I suspect that is the reason most people who have looked into it have
abandoned the idea of integration.

However, I start to see it as a possibility because of the way in GWT
you can attach GWT components to any DOM element... one way to
integrate would be to have wicket generate the GWT side based upon its
own configuration and bind the GWT components to the wicket/html
equivalent elements. That is by no means a hard plan, but certainly
something to try... Not sure yet how that would work on the server
side though (not enough experience with Wicket).

- Brill Pappin

On Wed, May 14, 2008 at 1:42 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 you can always generate a callback url using urlfor(interface) and
 then pass that url to the gwt component. for example of this see how
 Link generates a url that results in onLinkClicked() being invoked on
 it.

 -igor

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: AutoComplete enter key behavior

2008-05-14 Thread richardwilko

So you want the autocomplete behaviour, but only when you press the enter
key, ie you press enter and you get the same drop down box as you get in
normal autocomplete behaviour?

I dont think you can do this without making your own javascript, or hacking
at the original wicket-autocomplete.js

You could probably do it with an ajaxbehaviour like you have, and then
refresh a ListView, but this wouldnt be the same.




Ricky-22 wrote:
 
 Hi,
 Thanks for reply. I meant right now, there is an onChange event behavior
 attached to the autocomplete, which allows me to type in the text box and
 the list of possible matched choices appear; but what i also want is that
 when i press enter on the text box, it should give me list of choices
 (taking in some input search string).
 
 Is that possible without adding any additional java script ?
 
 Rick
 
 On Wed, May 14, 2008 at 12:40 PM, richardwilko 
 [EMAIL PROTECTED] wrote:
 

 Hi,

 We have changed our auto complete so that when you press enter on one of
 the
 choices in the drop down we submit the form (default is to just populate
 the
 box), is this what you mean?  unfortunatly to do this you need to hack
 the
 wicket-autocomplete.js at the point where the enter key is pressed and ad
 some manual javascript to do what you want.

 Richard




 Ricky-22 wrote:
 
  Hi,
 
  I am trying to add a behavior to my autoComplete text field, where if i
  press enter, it should be able to run a default search (with some text
  input) and display a list of possible choices);
 
  is it possible with autoComplete.add(new AjaxBehavior() {
 @Override
  public void onEvent() { }
  } );
 
   or some other additional component ?
 
  Any help would be appreciable.
  Rick
 
 

 --
 View this message in context:
 http://www.nabble.com/AutoComplete-%22enter%22-key-behavior-tp17234468p17235509.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 
 Regards
 Vyas, Anirudh
 ||  ॐ  ||
 
 

-- 
View this message in context: 
http://www.nabble.com/AutoComplete-%22enter%22-key-behavior-tp17234468p17238242.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A question about IHeaderContributor

2008-05-14 Thread Gerolf Seitz
gotcha, thx

On Wed, May 14, 2008 at 6:40 PM, Eelco Hillenius [EMAIL PROTECTED]
wrote:

  If you think it is a bug, please open a JIRA
  issue for it.
 
 
  didn't we EOL Wicket 1.2.x?
 
 http://martijndashorst.com/blog/2008/03/23/wicket-127-the-last-maintenance-release/

 Yeah, I actually meant for Wicket 1.3 and up, because the bug is in
 there as well.

 Eelco

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: FYI: new wicket site

2008-05-14 Thread Maarten Bosteels
Nice, but can I search by keyword ?
Suppose I want to search for the history of Ajax event mentioned by Eelco,
how can I do that ?

Maarten

On Wed, May 14, 2008 at 6:39 PM, Eelco Hillenius
[EMAIL PROTECTED] wrote:
 A new Wicket site is born! It's a Dutch site on which you can search for day
 trips and such. See: www.eropuit.nl.

 Nice. I like the 'history of Ajax' event. So soon ;-)

 Eelco

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread lars vonk
This is not yet implemented. So for now you'd have to know for instance when
and where it is and that will limit your search.

Lars


On Wed, May 14, 2008 at 9:30 PM, Maarten Bosteels [EMAIL PROTECTED]
wrote:

 Nice, but can I search by keyword ?
 Suppose I want to search for the history of Ajax event mentioned by
 Eelco,
 how can I do that ?

 Maarten

 On Wed, May 14, 2008 at 6:39 PM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
  A new Wicket site is born! It's a Dutch site on which you can search for
 day
  trips and such. See: www.eropuit.nl.
 
  Nice. I like the 'history of Ajax' event. So soon ;-)
 
  Eelco
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
so i just implemented IAuthorizationStrategy and on this line in my class:

public boolean isInstantiationAuthorized(Class ? extends Component
componentClass)

i get: Component is a raw type. References to generic type
ComponentT should be parameterized

so that means we have to change our sig to ? extends Component?
but then we are back to the problem described in this thread.

generics suck.

-igor

On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED] wrote:
 I dont think that user gets a warning if a param is of raw type. But
 we have a warning there.
 The problem is that for example MarkupContainer.add(Component) or
 IVisitor.visit(Component) i dont care what component is put in
 generified or not.
 In add it really doesnt matter because we dont do anything with it.
 With visitor it is different because the user could use it inside the
 method. But it should be useable without warnings for generified and
 none generfied components..


 On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 if we have a signature that accepts a raw type, will that also cause a
 warning in user's code?

 also having those suppress annotations practically _everywhere_ will be
 annoying

 -igor


 On Tue, May 13, 2008 at 11:56 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  I dont care, because i cant do any thing with the ? The only thing it
   enforces is that it must now be a generic class which is annoying. Not
   to mention that in that area eclipse and javac accept different
   things
 
   So or we in wicket dont use ? any where and have supress warning
   everywhere for that or we do use it and then suddenly it is in my eyes
   restricted to much.
 
 
 
   On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
Johan Compagner wrote:
 yes thats the reason

 you are calling the method add with a generified component but that
 container itself is not generified

 i dont like this about generics expecially the onces like this:

 add(MarkupContainer? container)

 then suddenly a none generified component cant be added...
 thats really stupid ? should mean anything.. including none
 generics
   
No, that's not correct. For example, List? is much more restrictive
than a raw List (which is a ListObject). To a raw list you can add an
instance of any type whatever, i.e., list.add(new Object()). But in
List? the ? is a wildcard which says it could be any type there,
 i.e.,
it could be a ListInteger. But you can't add a new Object() to a
ListInteger!
   
Thus MarkupContainer? means MarkupContainer parameterized by some
unknown type, and *not* MarkupContainer parameterized by Object, which
is what the raw type means.
   
Regards,
Sebastiaan
   
 johan


 On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
 [EMAIL PROTECTED]
 wrote:

 I have one idea,

 the reason of the warnigs is, that parent of AjaxPagingNavigator is
 PagingNavigator,
 which has parent Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:
 Mhmm, it is meaningful ;) I will know in future, thx

 One of the last occuring warning is, when working with
 MarkupContainer#add(...)  or  #addOrReplace(...)  method.

 Example:  I have a simple AjaxPagingNavigator, to which I add a
 simple
 ListView

 ---
 ListViewInteger menu = new ListViewInteger(id, numbers){
 //populate metods
 }
 add(menu);//warning here

 The warning says:
 Type safety: The method add(Component...) belongs to the raw type
 MarkupContainer.
 References to generic type MarkupContainerT should be
 parameterized

 I cannot find out, what's the warning reason, because ListView self
 is
 parameterized.


 --
 View this message in context:

   
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
 Sent from the Wicket - User mailing list archive at Nabble.com.



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



   
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
yes then all the call to that method must be of a generic type.
cant be raw

i dont know what are we going to do in wicket i think we should decide it
should we just where we dont care about generic delete/not use the ? and
then
supresswarning?

johan


On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 so i just implemented IAuthorizationStrategy and on this line in my class:

 public boolean isInstantiationAuthorized(Class ? extends Component
 componentClass)

 i get: Component is a raw type. References to generic type
 ComponentT should be parameterized

 so that means we have to change our sig to ? extends Component?
 but then we are back to the problem described in this thread.

 generics suck.

 -igor

 On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  I dont think that user gets a warning if a param is of raw type. But
  we have a warning there.
  The problem is that for example MarkupContainer.add(Component) or
  IVisitor.visit(Component) i dont care what component is put in
  generified or not.
  In add it really doesnt matter because we dont do anything with it.
  With visitor it is different because the user could use it inside the
  method. But it should be useable without warnings for generified and
  none generfied components..
 
 
  On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
  if we have a signature that accepts a raw type, will that also cause a
  warning in user's code?
 
  also having those suppress annotations practically _everywhere_ will be
  annoying
 
  -igor
 
 
  On Tue, May 13, 2008 at 11:56 PM, Johan Compagner [EMAIL PROTECTED]
 
  wrote:
   I dont care, because i cant do any thing with the ? The only thing it
enforces is that it must now be a generic class which is annoying.
 Not
to mention that in that area eclipse and javac accept different
things
  
So or we in wicket dont use ? any where and have supress warning
everywhere for that or we do use it and then suddenly it is in my
 eyes
restricted to much.
  
  
  
On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Johan Compagner wrote:
  yes thats the reason
 
  you are calling the method add with a generified component but
 that
  container itself is not generified
 
  i dont like this about generics expecially the onces like this:
 
  add(MarkupContainer? container)
 
  then suddenly a none generified component cant be added...
  thats really stupid ? should mean anything.. including none
  generics

 No, that's not correct. For example, List? is much more
 restrictive
 than a raw List (which is a ListObject). To a raw list you can
 add an
 instance of any type whatever, i.e., list.add(new Object()). But in
 List? the ? is a wildcard which says it could be any type there,
  i.e.,
 it could be a ListInteger. But you can't add a new Object() to a
 ListInteger!

 Thus MarkupContainer? means MarkupContainer parameterized by
 some
 unknown type, and *not* MarkupContainer parameterized by Object,
 which
 is what the raw type means.

 Regards,
 Sebastiaan

  johan
 
 
  On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
  [EMAIL PROTECTED]
  wrote:
 
  I have one idea,
 
  the reason of the warnigs is, that parent of AjaxPagingNavigator
 is
  PagingNavigator,
  which has parent Panel --- that is not parameterized.
 
  The same problem is with LoopItem, which extends the
  WebMarkupContainer --- that is not parameterized.
 
  ? could this be the reason ?
 
 
 
 
 
 
  Stefan Simik wrote:
  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
  ListView
 
  ---
  ListViewInteger menu = new ListViewInteger(id, numbers){
  //populate metods
  }
  add(menu);//warning here
 
  The warning says:
  Type safety: The method add(Component...) belongs to the raw
 type
  MarkupContainer.
  References to generic type MarkupContainerT should be
  parameterized
 
  I cannot find out, what's the warning reason, because ListView
 self
  is
  parameterized.
 
 
  --
  View this message in context:
 

 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
then our users have to suppress warnings in their code, which is
unacceptable at least to me. the whole generics thing turned out to be
quiet a lot crappier then i thought it would.

-igor


On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 yes then all the call to that method must be of a generic type.
 cant be raw

 i dont know what are we going to do in wicket i think we should decide it
 should we just where we dont care about generic delete/not use the ? and
 then
 supresswarning?

 johan


 On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 so i just implemented IAuthorizationStrategy and on this line in my class:

 public boolean isInstantiationAuthorized(Class ? extends Component
 componentClass)

 i get: Component is a raw type. References to generic type
 ComponentT should be parameterized

 so that means we have to change our sig to ? extends Component?
 but then we are back to the problem described in this thread.

 generics suck.

 -igor

 On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  I dont think that user gets a warning if a param is of raw type. But
  we have a warning there.
  The problem is that for example MarkupContainer.add(Component) or
  IVisitor.visit(Component) i dont care what component is put in
  generified or not.
  In add it really doesnt matter because we dont do anything with it.
  With visitor it is different because the user could use it inside the
  method. But it should be useable without warnings for generified and
  none generfied components..
 
 
  On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
  if we have a signature that accepts a raw type, will that also cause a
  warning in user's code?
 
  also having those suppress annotations practically _everywhere_ will be
  annoying
 
  -igor
 
 
  On Tue, May 13, 2008 at 11:56 PM, Johan Compagner [EMAIL PROTECTED]
 
  wrote:
   I dont care, because i cant do any thing with the ? The only thing it
enforces is that it must now be a generic class which is annoying.
 Not
to mention that in that area eclipse and javac accept different
things
  
So or we in wicket dont use ? any where and have supress warning
everywhere for that or we do use it and then suddenly it is in my
 eyes
restricted to much.
  
  
  
On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Johan Compagner wrote:
  yes thats the reason
 
  you are calling the method add with a generified component but
 that
  container itself is not generified
 
  i dont like this about generics expecially the onces like this:
 
  add(MarkupContainer? container)
 
  then suddenly a none generified component cant be added...
  thats really stupid ? should mean anything.. including none
  generics

 No, that's not correct. For example, List? is much more
 restrictive
 than a raw List (which is a ListObject). To a raw list you can
 add an
 instance of any type whatever, i.e., list.add(new Object()). But in
 List? the ? is a wildcard which says it could be any type there,
  i.e.,
 it could be a ListInteger. But you can't add a new Object() to a
 ListInteger!

 Thus MarkupContainer? means MarkupContainer parameterized by
 some
 unknown type, and *not* MarkupContainer parameterized by Object,
 which
 is what the raw type means.

 Regards,
 Sebastiaan

  johan
 
 
  On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
  [EMAIL PROTECTED]
  wrote:
 
  I have one idea,
 
  the reason of the warnigs is, that parent of AjaxPagingNavigator
 is
  PagingNavigator,
  which has parent Panel --- that is not parameterized.
 
  The same problem is with LoopItem, which extends the
  WebMarkupContainer --- that is not parameterized.
 
  ? could this be the reason ?
 
 
 
 
 
 
  Stefan Simik wrote:
  Mhmm, it is meaningful ;) I will know in future, thx
 
  One of the last occuring warning is, when working with
  MarkupContainer#add(...)  or  #addOrReplace(...)  method.
 
  Example:  I have a simple AjaxPagingNavigator, to which I add a
  simple
  ListView
 
  ---
  ListViewInteger menu = new ListViewInteger(id, numbers){
  //populate metods
  }
  add(menu);//warning here
 
  The warning says:
  Type safety: The method add(Component...) belongs to the raw
 type
  MarkupContainer.
  References to generic type MarkupContainerT should be
  parameterized
 
  I cannot find out, what's the warning reason, because ListView
 self
  is
  parameterized.
 
 
  --
  View this message in context:
 

 
 http://www.nabble.com/Using-generics-with-some-non-generic-classes-in-Wicket-tp17208928p17212015.html
  Sent 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk

Igor Vaynberg wrote:

then our users have to suppress warnings in their code, which is
unacceptable at least to me. the whole generics thing turned out to be
quiet a lot crappier then i thought it would.


I actually like having the generics better than not having it. In both 
cases sometimes it's a pain: generics is verbose, non-generics you have 
to use typecasts all the time and a bunch of errors are delayed to runtime.


What I don't really understand is, if you don't like generics, why can't 
you just tell the compiler to ignore the warnings? I mean, in Java 5 
generics is just not really optional, not in the JDK libs either - if 
you ignore generics there you get warnings as well; so there too, it's 
the user's burden to bear.


And especially if you look at the vote result, I think the majority 
wants the generics...


Regards,
Sebastiaan



-igor


On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED] wrote:

yes then all the call to that method must be of a generic type.
cant be raw

i dont know what are we going to do in wicket i think we should decide it
should we just where we dont care about generic delete/not use the ? and
then
supresswarning?

johan


On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:


so i just implemented IAuthorizationStrategy and on this line in my class:

public boolean isInstantiationAuthorized(Class ? extends Component
componentClass)

i get: Component is a raw type. References to generic type
ComponentT should be parameterized

so that means we have to change our sig to ? extends Component?
but then we are back to the problem described in this thread.

generics suck.

-igor

On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
wrote:

I dont think that user gets a warning if a param is of raw type. But
we have a warning there.
The problem is that for example MarkupContainer.add(Component) or
IVisitor.visit(Component) i dont care what component is put in
generified or not.
In add it really doesnt matter because we dont do anything with it.
With visitor it is different because the user could use it inside the
method. But it should be useable without warnings for generified and
none generfied components..


On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:

if we have a signature that accepts a raw type, will that also cause a
warning in user's code?

also having those suppress annotations practically _everywhere_ will be
annoying

-igor


On Tue, May 13, 2008 at 11:56 PM, Johan Compagner [EMAIL PROTECTED]
wrote:

I dont care, because i cant do any thing with the ? The only thing it
 enforces is that it must now be a generic class which is annoying.

Not

 to mention that in that area eclipse and javac accept different
 things

 So or we in wicket dont use ? any where and have supress warning
 everywhere for that or we do use it and then suddenly it is in my

eyes

 restricted to much.



 On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
  Johan Compagner wrote:
   yes thats the reason
  
   you are calling the method add with a generified component but

that

   container itself is not generified
  
   i dont like this about generics expecially the onces like this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none

generics

 
  No, that's not correct. For example, List? is much more

restrictive

  than a raw List (which is a ListObject). To a raw list you can

add an

  instance of any type whatever, i.e., list.add(new Object()). But in
  List? the ? is a wildcard which says it could be any type there,

i.e.,

  it could be a ListInteger. But you can't add a new Object() to a
  ListInteger!
 
  Thus MarkupContainer? means MarkupContainer parameterized by

some

  unknown type, and *not* MarkupContainer parameterized by Object,

which

  is what the raw type means.
 
  Regards,
  Sebastiaan
 
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik

[EMAIL PROTECTED]

   wrote:
  
   I have one idea,
  
   the reason of the warnigs is, that parent of AjaxPagingNavigator

is

   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
   Mhmm, it is meaningful ;) I will know in future, thx
  
   One of the last occuring warning is, when working with
   MarkupContainer#add(...)  or  #addOrReplace(...)  method.
  
   Example:  I have a simple AjaxPagingNavigator, to which I add a

simple

   ListView
  

---

   ListViewInteger menu = new ListViewInteger(id, numbers){
   //populate metods
   }
   add(menu);//warning here
  
   The warning says:
   Type safety: The method add(Component...) belongs to the 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Johan Compagner
how do users get in this situation a warning?

if we as a framework say method(RawType type)
then why would that give a warning in the caller method?
We just say we accept raw type there

johan


On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 then our users have to suppress warnings in their code, which is
 unacceptable at least to me. the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 -igor


 On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  yes then all the call to that method must be of a generic type.
  cant be raw
 
  i dont know what are we going to do in wicket i think we should decide it
  should we just where we dont care about generic delete/not use the ?
 and
  then
  supresswarning?
 
  johan
 
 
  On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:
 
  so i just implemented IAuthorizationStrategy and on this line in my
 class:
 
  public boolean isInstantiationAuthorized(Class ? extends Component
  componentClass)
 
  i get: Component is a raw type. References to generic type
  ComponentT should be parameterized
 
  so that means we have to change our sig to ? extends Component?
  but then we are back to the problem described in this thread.
 
  generics suck.
 
  -igor
 
  On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
 
  wrote:
   I dont think that user gets a warning if a param is of raw type. But
   we have a warning there.
   The problem is that for example MarkupContainer.add(Component) or
   IVisitor.visit(Component) i dont care what component is put in
   generified or not.
   In add it really doesnt matter because we dont do anything with it.
   With visitor it is different because the user could use it inside the
   method. But it should be useable without warnings for generified and
   none generfied components..
  
  
   On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
   if we have a signature that accepts a raw type, will that also cause
 a
   warning in user's code?
  
   also having those suppress annotations practically _everywhere_ will
 be
   annoying
  
   -igor
  
  
   On Tue, May 13, 2008 at 11:56 PM, Johan Compagner 
 [EMAIL PROTECTED]
  
   wrote:
I dont care, because i cant do any thing with the ? The only thing
 it
 enforces is that it must now be a generic class which is annoying.
  Not
 to mention that in that area eclipse and javac accept different
 things
   
 So or we in wicket dont use ? any where and have supress warning
 everywhere for that or we do use it and then suddenly it is in my
  eyes
 restricted to much.
   
   
   
 On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
  Johan Compagner wrote:
   yes thats the reason
  
   you are calling the method add with a generified component but
  that
   container itself is not generified
  
   i dont like this about generics expecially the onces like
 this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none
   generics
 
  No, that's not correct. For example, List? is much more
  restrictive
  than a raw List (which is a ListObject). To a raw list you can
  add an
  instance of any type whatever, i.e., list.add(new Object()). But
 in
  List? the ? is a wildcard which says it could be any type
 there,
   i.e.,
  it could be a ListInteger. But you can't add a new Object() to
 a
  ListInteger!
 
  Thus MarkupContainer? means MarkupContainer parameterized by
  some
  unknown type, and *not* MarkupContainer parameterized by
 Object,
  which
  is what the raw type means.
 
  Regards,
  Sebastiaan
 
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
   [EMAIL PROTECTED]
   wrote:
  
   I have one idea,
  
   the reason of the warnigs is, that parent of
 AjaxPagingNavigator
  is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
  
  
   Stefan Simik wrote:
   Mhmm, it is meaningful ;) I will know in future, thx
  
   One of the last occuring warning is, when working with
   MarkupContainer#add(...)  or  #addOrReplace(...)  method.
  
   Example:  I have a simple AjaxPagingNavigator, to which I
 add a
   simple
   ListView
  
  
 ---
   ListViewInteger menu = new ListViewInteger(id,
 numbers){
   //populate metods
   }
   add(menu);//warning here
  
   The warning says:
   Type safety: The 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
just try it, line 6 will giveyou the warning, so we have no choice but
to declare it as Class? extends Component?

01: public static class Test implements IAuthorizationStrategy {
02:public boolean isActionAuthorized(Component ?  component,
Action action)
03:{
04:throw new UnsupportedOperationException();
05:}
06:public boolean isInstantiationAuthorized(Class ? extends
Component componentClass)
07:{
08:throw new UnsupportedOperationException();
09:}
10:}

-igor



On Wed, May 14, 2008 at 1:29 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 how do users get in this situation a warning?

 if we as a framework say method(RawType type)
 then why would that give a warning in the caller method?
 We just say we accept raw type there

 johan


 On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 then our users have to suppress warnings in their code, which is
 unacceptable at least to me. the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 -igor


 On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:
  yes then all the call to that method must be of a generic type.
  cant be raw
 
  i dont know what are we going to do in wicket i think we should decide it
  should we just where we dont care about generic delete/not use the ?
 and
  then
  supresswarning?
 
  johan
 
 
  On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:
 
  so i just implemented IAuthorizationStrategy and on this line in my
 class:
 
  public boolean isInstantiationAuthorized(Class ? extends Component
  componentClass)
 
  i get: Component is a raw type. References to generic type
  ComponentT should be parameterized
 
  so that means we have to change our sig to ? extends Component?
  but then we are back to the problem described in this thread.
 
  generics suck.
 
  -igor
 
  On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
 
  wrote:
   I dont think that user gets a warning if a param is of raw type. But
   we have a warning there.
   The problem is that for example MarkupContainer.add(Component) or
   IVisitor.visit(Component) i dont care what component is put in
   generified or not.
   In add it really doesnt matter because we dont do anything with it.
   With visitor it is different because the user could use it inside the
   method. But it should be useable without warnings for generified and
   none generfied components..
  
  
   On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
   if we have a signature that accepts a raw type, will that also cause
 a
   warning in user's code?
  
   also having those suppress annotations practically _everywhere_ will
 be
   annoying
  
   -igor
  
  
   On Tue, May 13, 2008 at 11:56 PM, Johan Compagner 
 [EMAIL PROTECTED]
  
   wrote:
I dont care, because i cant do any thing with the ? The only thing
 it
 enforces is that it must now be a generic class which is annoying.
  Not
 to mention that in that area eclipse and javac accept different
 things
   
 So or we in wicket dont use ? any where and have supress warning
 everywhere for that or we do use it and then suddenly it is in my
  eyes
 restricted to much.
   
   
   
 On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
  Johan Compagner wrote:
   yes thats the reason
  
   you are calling the method add with a generified component but
  that
   container itself is not generified
  
   i dont like this about generics expecially the onces like
 this:
  
   add(MarkupContainer? container)
  
   then suddenly a none generified component cant be added...
   thats really stupid ? should mean anything.. including none
   generics
 
  No, that's not correct. For example, List? is much more
  restrictive
  than a raw List (which is a ListObject). To a raw list you can
  add an
  instance of any type whatever, i.e., list.add(new Object()). But
 in
  List? the ? is a wildcard which says it could be any type
 there,
   i.e.,
  it could be a ListInteger. But you can't add a new Object() to
 a
  ListInteger!
 
  Thus MarkupContainer? means MarkupContainer parameterized by
  some
  unknown type, and *not* MarkupContainer parameterized by
 Object,
  which
  is what the raw type means.
 
  Regards,
  Sebastiaan
 
   johan
  
  
   On Tue, May 13, 2008 at 5:55 PM, Stefan Simik
   [EMAIL PROTECTED]
   wrote:
  
   I have one idea,
  
   the reason of the warnigs is, that parent of
 AjaxPagingNavigator
  is
   PagingNavigator,
   which has parent Panel --- that is not parameterized.
  
   The same problem is with LoopItem, which extends the
   WebMarkupContainer --- that is not parameterized.
  
   ? could this be the reason ?
  
  
  
  
 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl
In IDEA it is annoying when you enable inspection 'Raw use of  
parametrized class' which is generally quite useful


it will complain on

   protected boolean isPageAuthorized(final Class? extends Page  
pageClass)


so, no, you don't get a warning but a potentially useful inspection is  
more or less useless

(warnings have no effect once you get used to them)

Am 14.05.2008 um 22:29 schrieb Johan Compagner:


how do users get in this situation a warning?

if we as a framework say method(RawType type)
then why would that give a warning in the caller method?
We just say we accept raw type there

johan


On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg [EMAIL PROTECTED] 


wrote:


then our users have to suppress warnings in their code, which is
unacceptable at least to me. the whole generics thing turned out to  
be

quiet a lot crappier then i thought it would.

-igor


On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED] 


wrote:

yes then all the call to that method must be of a generic type.
cant be raw

i dont know what are we going to do in wicket i think we should  
decide it
should we just where we dont care about generic delete/not use the  
?

and

then
supresswarning?

johan


On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED] 


wrote:


so i just implemented IAuthorizationStrategy and on this line in my

class:


public boolean isInstantiationAuthorized(Class ? extends  
Component

componentClass)

i get: Component is a raw type. References to generic type
ComponentT should be parameterized

so that means we have to change our sig to ? extends Component?
but then we are back to the problem described in this thread.

generics suck.

-igor

On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]



wrote:
I dont think that user gets a warning if a param is of raw type.  
But

we have a warning there.
The problem is that for example MarkupContainer.add(Component) or
IVisitor.visit(Component) i dont care what component is put in
generified or not.
In add it really doesnt matter because we dont do anything with  
it.
With visitor it is different because the user could use it  
inside the
method. But it should be useable without warnings for generified  
and

none generfied components..


On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
if we have a signature that accepts a raw type, will that also  
cause

a

warning in user's code?

also having those suppress annotations practically _everywhere_  
will

be

annoying

-igor


On Tue, May 13, 2008 at 11:56 PM, Johan Compagner 

[EMAIL PROTECTED]



wrote:
I dont care, because i cant do any thing with the ? The only  
thing

it
enforces is that it must now be a generic class which is  
annoying.

Not

to mention that in that area eclipse and javac accept different
things

So or we in wicket dont use ? any where and have supress  
warning
everywhere for that or we do use it and then suddenly it is in  
my

eyes

restricted to much.



On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

Johan Compagner wrote:

yes thats the reason

you are calling the method add with a generified component but

that

container itself is not generified

i dont like this about generics expecially the onces like

this:


add(MarkupContainer? container)

then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none

generics


No, that's not correct. For example, List? is much more

restrictive
than a raw List (which is a ListObject). To a raw list you  
can

add an
instance of any type whatever, i.e., list.add(new Object()).  
But

in

List? the ? is a wildcard which says it could be any type

there,

i.e.,
it could be a ListInteger. But you can't add a new Object()  
to

a

ListInteger!

Thus MarkupContainer? means MarkupContainer parameterized by

some

unknown type, and *not* MarkupContainer parameterized by

Object,

which

is what the raw type means.

Regards,
Sebastiaan


johan


On Tue, May 13, 2008 at 5:55 PM, Stefan Simik

[EMAIL PROTECTED]

wrote:


I have one idea,

the reason of the warnigs is, that parent of

AjaxPagingNavigator

is

PagingNavigator,
which has parent Panel --- that is not parameterized.

The same problem is with LoopItem, which extends the
WebMarkupContainer --- that is not parameterized.

? could this be the reason ?






Stefan Simik wrote:

Mhmm, it is meaningful ;) I will know in future, thx

One of the last occuring warning is, when working with
MarkupContainer#add(...)  or  #addOrReplace(...)  method.

Example:  I have a simple AjaxPagingNavigator, to which I

add a

simple

ListView




---

ListViewInteger menu = new ListViewInteger(id,

numbers){

   //populate metods
}
add(menu);//warning here

The warning says:
Type safety: The method add(Component...) belongs to the

raw

type

MarkupContainer.
References to generic type MarkupContainerT 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
On Wed, May 14, 2008 at 1:20 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Igor Vaynberg wrote:

 then our users have to suppress warnings in their code, which is
 unacceptable at least to me. the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 I actually like having the generics better than not having it. In both cases
 sometimes it's a pain: generics is verbose, non-generics you have to use
 typecasts all the time and a bunch of errors are delayed to runtime.

maybe it is just me, but i dont remember the last time i got a class
cast exception when casting down the model object. i write wicket code
every day. but i will say that imodeluser is definetely a huge
improvement/benefit.

 What I don't really understand is, if you don't like generics, why can't you
 just tell the compiler to ignore the warnings? I mean, in Java 5 generics is
 just not really optional, not in the JDK libs either - if you ignore
 generics there you get warnings as well; so there too, it's the user's
 burden to bear.

i do like generics. did i ever say otherwise? the problem here is that
if we scope something as Class? extends Component then even though
you ARE using generics in your code you will still get a warning
because we did not scope the class as Class? extends Component?.

on the other hand if we do scope it as Class? extends Component?
then you can no longer pass a raw reference when calling the function.

so we are screwed if we do and we are screwed if we dont, i expected
generics to be better.

 And especially if you look at the vote result, I think the majority wants
 the generics...

that vote was before we uncovered this issue. we voted on the idea of
generics, not on the implementation.

-igor



 Regards,
 Sebastiaan


 -igor


 On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

 yes then all the call to that method must be of a generic type.
 cant be raw

 i dont know what are we going to do in wicket i think we should decide it
 should we just where we dont care about generic delete/not use the ?
 and
 then
 supresswarning?

 johan


 On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 so i just implemented IAuthorizationStrategy and on this line in my
 class:

 public boolean isInstantiationAuthorized(Class ? extends Component
 componentClass)

 i get: Component is a raw type. References to generic type
 ComponentT should be parameterized

 so that means we have to change our sig to ? extends Component?
 but then we are back to the problem described in this thread.

 generics suck.

 -igor

 On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]
 wrote:

 I dont think that user gets a warning if a param is of raw type. But
 we have a warning there.
 The problem is that for example MarkupContainer.add(Component) or
 IVisitor.visit(Component) i dont care what component is put in
 generified or not.
 In add it really doesnt matter because we dont do anything with it.
 With visitor it is different because the user could use it inside the
 method. But it should be useable without warnings for generified and
 none generfied components..


 On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:

 if we have a signature that accepts a raw type, will that also cause a
 warning in user's code?

 also having those suppress annotations practically _everywhere_ will
 be
 annoying

 -igor


 On Tue, May 13, 2008 at 11:56 PM, Johan Compagner
 [EMAIL PROTECTED]
 wrote:

 I dont care, because i cant do any thing with the ? The only thing it
  enforces is that it must now be a generic class which is annoying.

 Not

  to mention that in that area eclipse and javac accept different
  things

  So or we in wicket dont use ? any where and have supress warning
  everywhere for that or we do use it and then suddenly it is in my

 eyes

  restricted to much.



  On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
   Johan Compagner wrote:
yes thats the reason
   
you are calling the method add with a generified component but

 that

container itself is not generified
   
i dont like this about generics expecially the onces like this:
   
add(MarkupContainer? container)
   
then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including none

 generics

  
   No, that's not correct. For example, List? is much more

 restrictive

   than a raw List (which is a ListObject). To a raw list you can

 add an

   instance of any type whatever, i.e., list.add(new Object()). But
 in
   List? the ? is a wildcard which says it could be any type there,

 i.e.,

   it could be a ListInteger. But you can't add a new Object() to a
   ListInteger!
  
   Thus MarkupContainer? means MarkupContainer parameterized by

 some

   unknown type, and *not* MarkupContainer parameterized by Object,

 which

   is what the raw type means.
  
   Regards,
   Sebastiaan
  

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
well, maybe you get used to warnings, i tend to do something about
them and clean up my code. i do not want to turn this warning off,
because as you said yourself it is a very useful warning, if i turn it
off i might as well not be using generics...

-igor


On Wed, May 14, 2008 at 1:38 PM, Peter Ertl [EMAIL PROTECTED] wrote:
 In IDEA it is annoying when you enable inspection 'Raw use of parametrized
 class' which is generally quite useful

 it will complain on

   protected boolean isPageAuthorized(final Class? extends Page pageClass)

 so, no, you don't get a warning but a potentially useful inspection is more
 or less useless
 (warnings have no effect once you get used to them)

 Am 14.05.2008 um 22:29 schrieb Johan Compagner:

 how do users get in this situation a warning?

 if we as a framework say method(RawType type)
 then why would that give a warning in the caller method?
 We just say we accept raw type there

 johan


 On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 then our users have to suppress warnings in their code, which is
 unacceptable at least to me. the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 -igor


 On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED]
 wrote:

 yes then all the call to that method must be of a generic type.
 cant be raw

 i dont know what are we going to do in wicket i think we should decide
 it
 should we just where we dont care about generic delete/not use the ?

 and

 then
 supresswarning?

 johan


 On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

 so i just implemented IAuthorizationStrategy and on this line in my

 class:

 public boolean isInstantiationAuthorized(Class ? extends Component
 componentClass)

 i get: Component is a raw type. References to generic type
 ComponentT should be parameterized

 so that means we have to change our sig to ? extends Component?
 but then we are back to the problem described in this thread.

 generics suck.

 -igor

 On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]

 wrote:

 I dont think that user gets a warning if a param is of raw type. But
 we have a warning there.
 The problem is that for example MarkupContainer.add(Component) or
 IVisitor.visit(Component) i dont care what component is put in
 generified or not.
 In add it really doesnt matter because we dont do anything with it.
 With visitor it is different because the user could use it inside the
 method. But it should be useable without warnings for generified and
 none generfied components..


 On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:

 if we have a signature that accepts a raw type, will that also cause

 a

 warning in user's code?

 also having those suppress annotations practically _everywhere_ will

 be

 annoying

 -igor


 On Tue, May 13, 2008 at 11:56 PM, Johan Compagner 

 [EMAIL PROTECTED]

 wrote:

 I dont care, because i cant do any thing with the ? The only thing

 it

 enforces is that it must now be a generic class which is annoying.

 Not

 to mention that in that area eclipse and javac accept different
 things

 So or we in wicket dont use ? any where and have supress warning
 everywhere for that or we do use it and then suddenly it is in my

 eyes

 restricted to much.



 On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

 Johan Compagner wrote:

 yes thats the reason

 you are calling the method add with a generified component but

 that

 container itself is not generified

 i dont like this about generics expecially the onces like

 this:

 add(MarkupContainer? container)

 then suddenly a none generified component cant be added...
 thats really stupid ? should mean anything.. including none

 generics

 No, that's not correct. For example, List? is much more

 restrictive

 than a raw List (which is a ListObject). To a raw list you can

 add an

 instance of any type whatever, i.e., list.add(new Object()). But

 in

 List? the ? is a wildcard which says it could be any type

 there,

 i.e.,

 it could be a ListInteger. But you can't add a new Object() to

 a

 ListInteger!

 Thus MarkupContainer? means MarkupContainer parameterized by

 some

 unknown type, and *not* MarkupContainer parameterized by

 Object,

 which

 is what the raw type means.

 Regards,
 Sebastiaan

 johan


 On Tue, May 13, 2008 at 5:55 PM, Stefan Simik

 [EMAIL PROTECTED]

 wrote:

 I have one idea,

 the reason of the warnigs is, that parent of

 AjaxPagingNavigator

 is

 PagingNavigator,
 which has parent Panel --- that is not parameterized.

 The same problem is with LoopItem, which extends the
 WebMarkupContainer --- that is not parameterized.

 ? could this be the reason ?






 Stefan Simik wrote:

 Mhmm, it is meaningful ;) I will know in future, thx

 One of the last occuring warning is, when working with
 MarkupContainer#add(...)  or  #addOrReplace(...)  method.

 Example:  I have a simple 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl

that's exactly what I am saying...

It always pisses me off to see developers checking in code
that delivers like 50-100 warnings and they don't care.

warnings are a good thing.

not so sure about generics (just kidding :-)


Am 14.05.2008 um 22:41 schrieb Igor Vaynberg:


well, maybe you get used to warnings, i tend to do something about
them and clean up my code. i do not want to turn this warning off,
because as you said yourself it is a very useful warning, if i turn it
off i might as well not be using generics...

-igor


On Wed, May 14, 2008 at 1:38 PM, Peter Ertl [EMAIL PROTECTED]  
wrote:
In IDEA it is annoying when you enable inspection 'Raw use of  
parametrized

class' which is generally quite useful

it will complain on

 protected boolean isPageAuthorized(final Class? extends Page  
pageClass)


so, no, you don't get a warning but a potentially useful inspection  
is more

or less useless
(warnings have no effect once you get used to them)

Am 14.05.2008 um 22:29 schrieb Johan Compagner:


how do users get in this situation a warning?

if we as a framework say method(RawType type)
then why would that give a warning in the caller method?
We just say we accept raw type there

johan


On Wed, May 14, 2008 at 9:53 PM, Igor Vaynberg [EMAIL PROTECTED] 


wrote:


then our users have to suppress warnings in their code, which is
unacceptable at least to me. the whole generics thing turned out  
to be

quiet a lot crappier then i thought it would.

-igor


On Wed, May 14, 2008 at 12:48 PM, Johan Compagner [EMAIL PROTECTED] 


wrote:


yes then all the call to that method must be of a generic type.
cant be raw

i dont know what are we going to do in wicket i think we should  
decide

it
should we just where we dont care about generic delete/not use  
the ?


and


then
supresswarning?

johan


On Wed, May 14, 2008 at 9:45 PM, Igor Vaynberg [EMAIL PROTECTED] 


wrote:

so i just implemented IAuthorizationStrategy and on this line  
in my


class:


public boolean isInstantiationAuthorized(Class ? extends  
Component

componentClass)

i get: Component is a raw type. References to generic type
ComponentT should be parameterized

so that means we have to change our sig to ? extends  
Component?

but then we are back to the problem described in this thread.

generics suck.

-igor

On Wed, May 14, 2008 at 12:12 AM, Johan Compagner [EMAIL PROTECTED]



wrote:


I dont think that user gets a warning if a param is of raw  
type. But

we have a warning there.
The problem is that for example MarkupContainer.add(Component)  
or

IVisitor.visit(Component) i dont care what component is put in
generified or not.
In add it really doesnt matter because we dont do anything  
with it.
With visitor it is different because the user could use it  
inside the
method. But it should be useable without warnings for  
generified and

none generfied components..


On 5/14/08, Igor Vaynberg [EMAIL PROTECTED] wrote:


if we have a signature that accepts a raw type, will that  
also cause


a


warning in user's code?

also having those suppress annotations practically  
_everywhere_ will


be


annoying

-igor


On Tue, May 13, 2008 at 11:56 PM, Johan Compagner 


[EMAIL PROTECTED]



wrote:


I dont care, because i cant do any thing with the ? The only  
thing


it


enforces is that it must now be a generic class which is  
annoying.


Not


to mention that in that area eclipse and javac accept  
different

things

So or we in wicket dont use ? any where and have supress  
warning
everywhere for that or we do use it and then suddenly it is  
in my


eyes


restricted to much.



On 5/14/08, Sebastiaan van Erk [EMAIL PROTECTED] wrote:


Johan Compagner wrote:


yes thats the reason

you are calling the method add with a generified component  
but


that


container itself is not generified

i dont like this about generics expecially the onces like


this:


add(MarkupContainer? container)

then suddenly a none generified component cant be added...
thats really stupid ? should mean anything.. including  
none


generics


No, that's not correct. For example, List? is much more


restrictive


than a raw List (which is a ListObject). To a raw list  
you can


add an


instance of any type whatever, i.e., list.add(new  
Object()). But


in


List? the ? is a wildcard which says it could be any type


there,


i.e.,


it could be a ListInteger. But you can't add a new  
Object() to


a


ListInteger!

Thus MarkupContainer? means MarkupContainer  
parameterized by


some


unknown type, and *not* MarkupContainer parameterized by


Object,


which


is what the raw type means.

Regards,
Sebastiaan


johan


On Tue, May 13, 2008 at 5:55 PM, Stefan Simik


[EMAIL PROTECTED]


wrote:


I have one idea,

the reason of the warnigs is, that parent of


AjaxPagingNavigator


is


PagingNavigator,
which has parent Panel --- that is not parameterized.

The same problem is with LoopItem, which extends the
WebMarkupContainer --- that is not 

Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk

Igor Vaynberg wrote:


i do like generics. did i ever say otherwise? the problem here is that
if we scope something as Class? extends Component then even though
you ARE using generics in your code you will still get a warning
because we did not scope the class as Class? extends Component?.

on the other hand if we do scope it as Class? extends Component?
then you can no longer pass a raw reference when calling the function.


But that's exactly the point isn't it? If you're using generics then you 
shouldn't be using raw Components anymore...



so we are screwed if we do and we are screwed if we dont, i expected
generics to be better.


Well they definitely could have been better (erasure is terrible if you 
ask me), but I don't see what's wrong in this case. It warns you if you 
should be using a parameterized type but you don't.



And especially if you look at the vote result, I think the majority wants
the generics...


that vote was before we uncovered this issue. we voted on the idea of
generics, not on the implementation.


That's true, but I wonder if this issue would change the vote much. I 
don't really understand why it's an issue, because you can use 
generified Components always: ComponentObject if you don't want to 
constrain the model object, and ComponentVoid if you don't need a model.


The question that started the thread was about StringResourceModel which 
was not yet generified, and in that case, the warning seems to me to be 
perfectly ok: it just says StringResourceModel should be generified. 
It's not a release yet, so that some users who use the current snapshot 
run into these kind of warnings which cannot be removed seems to be fine 
to me...


Regards,
Sebastiaan



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Eelco Hillenius
 the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

:-)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FYI: new wicket site

2008-05-14 Thread jWeekend

Frank, 

Is there such a button (officially)? 
We just say Built on Apache Wicket at jWeekend.
It's probably not a bad idea (from Wicket's perspective) to have an official
image that can be used (or linked to), if there are no legal complications
with Apache.

Lars,

Thanks for the link - it's always interesting to see what's going on in
Wicketland; all the best with your venture.

Regards - Cemal
http://jWeekend.co.uk http://jWeekend.co.uk 




Frank Bille wrote:
 
 Very nice! But where is the Powered by Apache Wicket button?
 
 Frank
 
 On Wed, May 14, 2008 at 10:36 AM, lars vonk [EMAIL PROTECTED] wrote:
 Hi all,

 A new Wicket site is born! It's a Dutch site on which you can search for
 day
 trips and such. See: www.eropuit.nl.

 Thanks to the user- and dev-group for answering any questions we had
 during
 the process.

 Lars

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FYI%3A-new-wicket-site-tp17226228p17241227.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
since then the thread has evolved into whether or not we should use ?
extends Component or ? extends Component?

-igor


On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Igor Vaynberg wrote:

 i do like generics. did i ever say otherwise? the problem here is that
 if we scope something as Class? extends Component then even though
 you ARE using generics in your code you will still get a warning
 because we did not scope the class as Class? extends Component?.

 on the other hand if we do scope it as Class? extends Component?
 then you can no longer pass a raw reference when calling the function.

 But that's exactly the point isn't it? If you're using generics then you
 shouldn't be using raw Components anymore...

 so we are screwed if we do and we are screwed if we dont, i expected
 generics to be better.

 Well they definitely could have been better (erasure is terrible if you ask
 me), but I don't see what's wrong in this case. It warns you if you should
 be using a parameterized type but you don't.

 And especially if you look at the vote result, I think the majority wants
 the generics...

 that vote was before we uncovered this issue. we voted on the idea of
 generics, not on the implementation.

 That's true, but I wonder if this issue would change the vote much. I don't
 really understand why it's an issue, because you can use generified
 Components always: ComponentObject if you don't want to constrain the
 model object, and ComponentVoid if you don't need a model.

 The question that started the thread was about StringResourceModel which was
 not yet generified, and in that case, the warning seems to me to be
 perfectly ok: it just says StringResourceModel should be generified. It's
 not a release yet, so that some users who use the current snapshot run into
 these kind of warnings which cannot be removed seems to be fine to me...

 Regards,
 Sebastiaan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A question about IHeaderContributor

2008-05-14 Thread nate roe
Well I made a new behavior, extending AbstractBehavior implementing
IHeaderContributor.  I gave this behavior a reference to the Form that might
have errors, and I added the behavior to the Page on which the Form lives.
In this case, the behavior's renderHead(...) is called as expected.

I'm not going to open a JIRA because I'm not completely sure this is a bug
and I can't easily switch to Wicket 1.3 to confirm that it still exists.
The question though, is, can a Component implement IHeaderContributor
successfully?

On Wed, May 14, 2008 at 12:03 PM, Gerolf Seitz [EMAIL PROTECTED]
wrote:

 gotcha, thx

 On Wed, May 14, 2008 at 6:40 PM, Eelco Hillenius 
 [EMAIL PROTECTED]
 wrote:

   If you think it is a bug, please open a JIRA
   issue for it.
  
  
   didn't we EOL Wicket 1.2.x?
  
 
 http://martijndashorst.com/blog/2008/03/23/wicket-127-the-last-maintenance-release/
 
  Yeah, I actually meant for Wicket 1.3 and up, because the bug is in
  there as well.
 
  Eelco
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Eelco Hillenius
On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius
[EMAIL PROTECTED] wrote:
 the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 :-)

Generics for models: great. Generics for components: awful. Too bad
that stuff is contagious.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Peter Ertl

wicket 1.6 = scala-based ? *lol*


Am 14.05.2008 um 23:28 schrieb Eelco Hillenius:


On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius
[EMAIL PROTECTED] wrote:

the whole generics thing turned out to be
quiet a lot crappier then i thought it would.


:-)


Generics for models: great. Generics for components: awful. Too bad
that stuff is contagious.

Eelco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Sebastiaan van Erk

Igor Vaynberg wrote:

since then the thread has evolved into whether or not we should use ?
extends Component or ? extends Component?

-igor


I don't understand how that changes any of my points. The first is 
incorrect (from a generics point of view) since you're referencing an 
unparameterized generic type.


So the second gives warnings only in code that is not properly generified...

Regards,
Sebastiaan




On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:

Igor Vaynberg wrote:


i do like generics. did i ever say otherwise? the problem here is that
if we scope something as Class? extends Component then even though
you ARE using generics in your code you will still get a warning
because we did not scope the class as Class? extends Component?.

on the other hand if we do scope it as Class? extends Component?
then you can no longer pass a raw reference when calling the function.

But that's exactly the point isn't it? If you're using generics then you
shouldn't be using raw Components anymore...


so we are screwed if we do and we are screwed if we dont, i expected
generics to be better.

Well they definitely could have been better (erasure is terrible if you ask
me), but I don't see what's wrong in this case. It warns you if you should
be using a parameterized type but you don't.


And especially if you look at the vote result, I think the majority wants
the generics...

that vote was before we uncovered this issue. we voted on the idea of
generics, not on the implementation.

That's true, but I wonder if this issue would change the vote much. I don't
really understand why it's an issue, because you can use generified
Components always: ComponentObject if you don't want to constrain the
model object, and ComponentVoid if you don't need a model.

The question that started the thread was about StringResourceModel which was
not yet generified, and in that case, the warning seems to me to be
perfectly ok: it just says StringResourceModel should be generified. It's
not a release yet, so that some users who use the current snapshot run into
these kind of warnings which cannot be removed seems to be fine to me...

Regards,
Sebastiaan




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
yeah, generics are pretty damn viral

-igor

On Wed, May 14, 2008 at 2:28 PM, Eelco Hillenius
[EMAIL PROTECTED] wrote:
 On Wed, May 14, 2008 at 2:25 PM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
 the whole generics thing turned out to be
 quiet a lot crappier then i thought it would.

 :-)

 Generics for models: great. Generics for components: awful. Too bad
 that stuff is contagious.

 Eelco

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Igor Vaynberg
well, apparently johan ran into a situation where component? is too
restrictive...

-igor


On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED] wrote:
 Igor Vaynberg wrote:

 since then the thread has evolved into whether or not we should use ?
 extends Component or ? extends Component?

 -igor

 I don't understand how that changes any of my points. The first is incorrect
 (from a generics point of view) since you're referencing an unparameterized
 generic type.

 So the second gives warnings only in code that is not properly generified...

 Regards,
 Sebastiaan



 On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk [EMAIL PROTECTED]
 wrote:

 Igor Vaynberg wrote:

 i do like generics. did i ever say otherwise? the problem here is that
 if we scope something as Class? extends Component then even though
 you ARE using generics in your code you will still get a warning
 because we did not scope the class as Class? extends Component?.

 on the other hand if we do scope it as Class? extends Component?
 then you can no longer pass a raw reference when calling the function.

 But that's exactly the point isn't it? If you're using generics then you
 shouldn't be using raw Components anymore...

 so we are screwed if we do and we are screwed if we dont, i expected
 generics to be better.

 Well they definitely could have been better (erasure is terrible if you
 ask
 me), but I don't see what's wrong in this case. It warns you if you
 should
 be using a parameterized type but you don't.

 And especially if you look at the vote result, I think the majority
 wants
 the generics...

 that vote was before we uncovered this issue. we voted on the idea of
 generics, not on the implementation.

 That's true, but I wonder if this issue would change the vote much. I
 don't
 really understand why it's an issue, because you can use generified
 Components always: ComponentObject if you don't want to constrain the
 model object, and ComponentVoid if you don't need a model.

 The question that started the thread was about StringResourceModel which
 was
 not yet generified, and in that case, the warning seems to me to be
 perfectly ok: it just says StringResourceModel should be generified. It's
 not a release yet, so that some users who use the current snapshot run
 into
 these kind of warnings which cannot be removed seems to be fine to me...

 Regards,
 Sebastiaan



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using generics with some non-generic classes in Wicket

2008-05-14 Thread Gerolf Seitz
i think something similar happend to me with Model.valueOf(Map), so
i had to change it back to return Model instead of Model?

  Gerolf

On Wed, May 14, 2008 at 11:41 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 well, apparently johan ran into a situation where component? is too
 restrictive...

 -igor


 On Wed, May 14, 2008 at 2:37 PM, Sebastiaan van Erk [EMAIL PROTECTED]
 wrote:
  Igor Vaynberg wrote:
 
  since then the thread has evolved into whether or not we should use ?
  extends Component or ? extends Component?
 
  -igor
 
  I don't understand how that changes any of my points. The first is
 incorrect
  (from a generics point of view) since you're referencing an
 unparameterized
  generic type.
 
  So the second gives warnings only in code that is not properly
 generified...
 
  Regards,
  Sebastiaan
 
 
 
  On Wed, May 14, 2008 at 1:54 PM, Sebastiaan van Erk 
 [EMAIL PROTECTED]
  wrote:
 
  Igor Vaynberg wrote:
 
  i do like generics. did i ever say otherwise? the problem here is that
  if we scope something as Class? extends Component then even though
  you ARE using generics in your code you will still get a warning
  because we did not scope the class as Class? extends Component?.
 
  on the other hand if we do scope it as Class? extends Component?
  then you can no longer pass a raw reference when calling the function.
 
  But that's exactly the point isn't it? If you're using generics then
 you
  shouldn't be using raw Components anymore...
 
  so we are screwed if we do and we are screwed if we dont, i expected
  generics to be better.
 
  Well they definitely could have been better (erasure is terrible if you
  ask
  me), but I don't see what's wrong in this case. It warns you if you
  should
  be using a parameterized type but you don't.
 
  And especially if you look at the vote result, I think the majority
  wants
  the generics...
 
  that vote was before we uncovered this issue. we voted on the idea of
  generics, not on the implementation.
 
  That's true, but I wonder if this issue would change the vote much. I
  don't
  really understand why it's an issue, because you can use generified
  Components always: ComponentObject if you don't want to constrain the
  model object, and ComponentVoid if you don't need a model.
 
  The question that started the thread was about StringResourceModel
 which
  was
  not yet generified, and in that case, the warning seems to me to be
  perfectly ok: it just says StringResourceModel should be generified.
 It's
  not a release yet, so that some users who use the current snapshot run
  into
  these kind of warnings which cannot be removed seems to be fine to
 me...
 
  Regards,
  Sebastiaan
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RequiredBorder being applied multiple times in ajax calls

2008-05-14 Thread Sam Barnum

Using the tips in this PDF
http://londonwicket.org/content/LondonWicket-FormsWithFlair.pdf

I created the simple RequiredBorder class as follows:

public class RequiredBorder extends MarkupComponentBorder {
public void renderAfter(Component component) {
FormComponent fc = (FormComponent) component;
if (fc.isRequired()) {
super.renderAfter(component);
}
}
}

This basically adds a * after any required fields.  It seemed to  
work great until I used it with an ajax phone formatter behavior:


new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
Object oldValue = component.getValue();
String formatted = new PhoneFormatter().format(oldValue);
component.setModelObject(formatted);
target.addComponent(component);
}
}


This caused duplicate * indicators to appear after my phone field  
when the phone number changed, one per onchange request.  I tried  
adding a boolean field to the RequiredBorder so it only gets  
processed once.  This fixed the phone formatter duplicates, but if  
the form submits and stays on the same page, all the * marks  
disappear from the required fields.


This is definitely some sort of lifecycle problem, but how do you fix  
it?


On a related note, is it generally a bad idea to mix AJAX and non- 
ajax actions?  It seems like this is one of many issues I've run into  
when doing this.


Thanks,

-Sam Barnum

Re: Why Localizer Retained so many heapsize?

2008-05-14 Thread Quan Zhou
Maybe you're right.
Yesterday I deployed the application in a high load with a little fewer
heapsize than the usual setting to see whether the same thing happened
again,
and now the heapsize usage increase little by little. the Full GC interval
becomes shorter. I'm sure that several hours later.
I deeply explore the cache key and value; as you said, some thing with same
value but different key's store in the cache.
like:

first :
woodPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:4-zh_CN-null
产量:
ironPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:4-zh_CN-null
产量:
cropPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:4-zh_CN-null
产量:

later:
woodPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:6-zh_CN-null
产量:
ironPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:6-zh_CN-null
产量:
cropPr_lab-com.wedomo.webgame.fbm3guo.wicket.reuse.ResourcePanel:resourcepanel-com.wedomo.webgame.fbm3guo.wicket.pages.map.MapSmall:6-zh_CN-null
产量:

the only difference is PageId .  the source code of Locailzer.getCacheKey
tells
//
 for(Component cursor = component; cursor != null; cursor =
cursor.getParent())
{
buffer.append(-).append(cursor.getClass().getName());
buffer.append(:).append(cursor.getId());
}

so is the cursor.getId() useful when it represents a repeater? and whether i
can remove it when it represents the page class?
that would really reduce the cacheKey number I think.

Johan, could you show me the code you fix with this problem please?

Thanks for your great help!




2008/5/14 Johan Compagner [EMAIL PROTECTED]:

 i fixed something in the localizer that it doesnt add the page id to the
 cachekey string
 that was your problem
 everypage that was created also creates an localizer entry that is just
 plain wrong.

 So the pageid is not in the path anymore.. i think this is what really
 caused your constant growing cache


 On Wed, May 14, 2008 at 5:04 PM, Quan Zhou [EMAIL PROTECTED] wrote:

  Yes , it would be a bit slower. I'm going to make more test to see what
  havn't store in cache.
  Maybe i can caculate how many percents it effect my application
 performance
  after i deploy it in a high load circumstance.
 
  I'm not sure about what you said about your fix for not including page.
  can you make it some clear? thanks very much.
 
 
  2008/5/14 Johan Compagner [EMAIL PROTECTED]:
 
   ok so you dont store the tested cacheKey 's that returned null..
   so that could result in a bit slower access because it is tried to
  resolve
   everytime
  
   I do think that my fix for not including the page is solving your real
  mem
   leak problem
  
   johan
  
  
   On Wed, May 14, 2008 at 2:03 PM, Quan Zhou [EMAIL PROTECTED]
 wrote:
  
  getResourceSettings().setLocalizer(new Localizer() {
   @Override
   public void putIntoCache(final String cacheKey,final
 String
string) {
   if (string != null  cacheKey!=null)
   super.putIntoCache(cacheKey, string);
   }
   });
   
   
   
2008/5/14 Johan Compagner [EMAIL PROTECTED]:
   
 but what did you do there in that method?
 nothing? you dont cache anything anymore?

 On Wed, May 14, 2008 at 10:29 AM, Quan Zhou [EMAIL PROTECTED]
wrote:

  Hello everyone.
 
  I override Localizer.putIntoCache method. and it really reduce
 the
  heapsize
  usage of Localizer.
 
  The application is more stable now although the key remains
 large.
 
  Hope we can find a way to shorter the key length.
 
  thanks everyone.
 
  2008/5/13 Eirik Rude [EMAIL PROTECTED]:
 
  
   A soft reference is very common for this type of thing.  I know
   some
of
   ICU's
   resources are stored this way.
  
  
  
   Jonathan Locke wrote:
   
   
maybe localizer should limit its size or use a soft reference
cache?
   
   
Johan Compagner wrote:
   
Can you really see what it holds?
Almost 2G in memory in localizer is extreme... Thats really
 a
   lot
of
strings..
You could try to read that dump with yourkit if your current
  one
doesnt show enough.
   
On 5/9/08, Quan Zhou [EMAIL PROTECTED] wrote:
Hello everyone.
   
I recently develop my App use Wicket1.3.3. It's my first
 time
   to
 use
this
framework and I feel it's really really a perfect framework
  for
me.
My app support both Simplified Chinese , Traditional