Hi,

If Session.get() is called then a new Wicket Session is created. Unless
Session#bind() is called this session is temporary, i.e. it will be
discarded at the end of the request cycle.
If #bind() is called then a Http Session is created too and the Wicket
Session is stored in it as an attribute, and it will be reused in the
following requests.

To see why several Wicket sessions are created just put a breakpoint in
YourApp#newSession() and see the stacktrace.
The Wicket Session is exposed as ThreadLocal once created/looked up, so
Wicket won't call App#newSession() more than once per request. More
probably a request to resource (.css, .js, ...) creates a Session too.


On Thu, May 16, 2013 at 8:53 AM, Michael Zhavzharov <mzhavzha...@alee.ru>wrote:

> Hello!
> I have a webApp, that have a webSession witch creates a connector and many
> managers. When I starts an app, session creates 2 times. When the page is
> starting to render it creates another 2 times and every user, when
> connecting to this app, creates another 2 sessions.
> I just realized that if I starts an app with path
> http://localhost:8080/QuickStart/home ("home" is mounted as a home page),
> the session creates ones, but if I push
> http://localhost:8080/QuickStart/home?0 or
> http://localhost:8080/QuickStart
> it creates 2 times.
> Is it normal? And can I do something with this problem to make session
> creates only ones?
>
> Thank you!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Session-creates-multiple-times-tp4658837.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>

Reply via email to