Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Life cycle

TODO Describe the life cycle of Wicket apps, sessions and requests.
See Request processing overview. It's not exactly description of life cycles but is related to that.

Custom Sessions

The wicket way of storing objects in your session is by extending the wicket session. For example if you want to store some kind of user object in your session, you would create a getter and setter for it in
your custom wicket session:

...

Code Block
public class MySession extends WebSession {
   public MySession(WebApplicationRequest applicationrequest) {
      super(applicationrequest);
   }
   private String myAttribute;
   // ... getters and setters
}

and override either of the following methods on your Application class:

Code Block
protected@Override
public ISessionFactorySession getSessionFactory(newSession(Request request, Response response) {
   return return this.sessionFactorynew MySession(request);
}
public Session newSession() {
    return new MySession(WebApplication.this);
}

retreive the Session by

Code Block

MySession session = (MySession )WebSession.get();

Custom RequestCycles

Describe how to use custom request cycles.