Hi there,
we're developing a rather straight forward application with wicket and I am
wondering if it is ok to call setResponsePage(getPage()) inside the
onClick() method of a Link? Because the session size is constantly
increasing, here's my example:
Application class:
public class TestApplication extends WebApplication {
public TestApplication() {
super();
}
@Override
public Class getHomePage() {
return TestPage.class;
}
@Override
protected void init() {
super.init();
mountBookmarkablePage("/home", getHomePage());
}
}
Page class:
public class TestPage extends WebPage {
public TestPage() {
super();
setVersioned(false);
add(new TestLink("testLink"));
}
@Override
protected void onBeforeRender() {
super.onBeforeRender();
System.err.println(getSession().getSizeInBytes());
}
}
Link class:
public class TestLink extends Link {
public TestLink(String id) {
super(id);
}
@Override
public void onClick() {
setResponsePage(getPage());
}
}
Everytime the Link is clicked the session size increases a bit (it may be
tiny in this test application, it's nevertheless increasing constantly).
Whenever (this clue comes from testing our real application) a new page is
constructed (be it via setResponsePage(Page.class) or via url) the session
size falls back to normal. When an older instance (via back button or link)
is used, the session is as big as before.
I also noticed that when using TabbedPanel (from wicket-extensions) each tab
change (out of the box) increases the session size much more.
All our models are LoadableDetachableModels, so our model objects are all
transient and should never be stored in the session. Of course we use here
and there a new PropertyModel() and other wrapper models, but only in
constructors.
Any suggestion what we could do about it? In the real application the
increment is about 2-3Kb per click, which will become a problem since the
application is click-intensive and collaborative (many session at the same
time).
Thanks in advance,
Martin
--
View this message in context:
http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]