a stateless page in wicket means that the page does not need to be put into
session. it can be reconstructed from scratch. such pages generally do not
have stateful components (components that provide user with callbacks such
as link and its onclick() or form and its onsubmit()).

so until a stateful page is hit by the user wicket will not create an http
session. this is an optimization for sites that want to scale out to massive
amounts of users without requiring an http session.

now since websession plays an important role in request cycle processing and
is itself stored in http session we need to create a new instance on every
request until we are able to reuse the instance by putting it into http
session.

makes sense?

-igor

On Mon, Oct 13, 2008 at 9:00 PM, Craig Tataryn <[EMAIL PROTECTED]> wrote:

> Hi, I created a very simple little Wicket application which consisted
> of one page and the page relied on session information which was to
> persist between requests.  My surprise came when I found that
> newSession(Request request, Response response)  on my WebApplication
> class was being called for every request!  This is the first time I've
> come across this, usually sessions "just work" the way I figure they
> should (that is, stay around until they are expired).
>
> In my investigation as to how to remedy this situation I came across
> this list message:
> http://www.nabble.com/Session-creation-td19123581.html#a19128690
>
> So using "getSession().bind()" worked for me.
>
> What exactly triggers Wicket to say "oh, I should keep sessions around
> instead of creating them for every request".  Martijn seems to
> indicate that if your pages are "statefull" then Sessions will
> persist.  What is meant by "statefull"?  That they set stuff into the
> session?  Or that they have member variables?
>
> I noticed that bind() wasn't mentioned in WiA (first place I looked to
> seek help)  Seems like it would have been an excellent callout item,
> would have helped me anyway :)  Took me a while to find that mail list
> posting, trying various search terms.
>
> --
> Craig Tataryn
> site: http://www.basementcoders.com/
> podcast:http://feeds.feedburner.com/TheBasementCoders
> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
> im: [EMAIL PROTECTED], skype: craig.tataryn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to