tags:

views:

38

answers:

2

I have a wicket Application that has long lived Pages. I would like each instance of this Page to be created with a unique PageMap for reasons I won't get into here, but when I try to specify a PageMap on the constructor of my Page I end up getting OOM and StackOverflow errors. Here is the code:

public <CTOR>() {
    super(Session.get().newPageMap("" + System.currentTimeMillis()));
    ...

I'm using a custom BookmarkablePageLink (custom in that it does not pass on the current PageMap name to the new Page) to effectively abandon the old Page/PageMap and create a new one with a new PageMap. The errors seem to be coming from page serialization after only two or three pages have been created.

Can anyone find issue with this approach?

+1  A: 

I suspect deserialization will be calling this constructor so that you're getting more PageMaps than you expect.

Don Roby
Good call, I'm not sure that's the issue, but I should probably be calling pageMapForName(pageMapName, true) instead. Thanks!
Michael Krauklis
If you really want a new PageMap only when *you* create the page and not when it's deserialized, you probably should make the PageMap a constructor parameter, and do the pageMapForName in the caller, or just make the name a constructor parameter and do the name construction in the caller.Anantha is correct that you might get a better answer where the core developers hang out, though I think I've seen at least one of them on SO.
Don Roby
+1  A: 

I think you will get better anwers if you ask this type of questions in the wicket user mailing list. The mailing list is very active and the core developers will answer most of the questions.

Anantha Kumaran