On Mon, Sep 22, 2008 at 6:04 PM, Justin Morgan - Logic Sector < [EMAIL PROTECTED]> wrote:
> Create a custom Wicket session subclass that holds your portal: > > public class MySession extends WebSession { > private Portal _portal; > public MySession(Request request) { > super(request); > LOGGER.debug("Instantiated"); > _portal = new Portal(); > } > public Portal getPortal() { return _portal; } > public void setPortal(Portal portal) { _portal = portal; } > } > > Somewhere in your "normal" page: > ((MySession) getSession()).setPortal(myPortal); > > Somewhere in your PageExpiredPage: > Portal myPortal = ((MySession) getSession()).getPortal(); > > In your Wicket Application subclass: > /** @see org.apache.wicket.Application#newSession(Request, Response) */ > @Override > public Session newSession(Request request, Response response) { > return new MySession(request); > } > > Best regards, > > Justin Thanks! But i thought that the Session will be invalide when the PageExpired Error comes? Isn't that true? If not so, than your approach will be very fine.