Page Created :
WICKET :
Custom WebSession (Storing Objects In Session)
Custom WebSession (Storing Objects In Session) has been created by Will Hoover (Feb 13, 2008). Content:Extend WebSession and add your custom getters/setters: public final class MySession extends WebSession { private Object myObject; public PerManSession(Request request) { super(request); } public final Object getMyObject() { return myObject; } public final void setMyObject(Object myObject) { this.myObject = myObject; } } In your WebApplication you need to override the "newSession" method and return your session instance: public final class MyApplication extends WebApplication { ... @Override public final WebSession newSession() { return new MySession(); } ... } In your WebPage you can get/set your object: ... ((MySession)Session.get()).setMyObject(myObject); ... |
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences