>From HttpServletRequest javadocs: HttpSession getSession() Returns the current session associated with this request, or if the request does not have a session, creates one.
Use getSession(false) instead. To keep the page stateless you may use wicket-devutils StatelessChecker in Dev mode. On Fri, Apr 27, 2012 at 10:41 AM, Jürgen Lind <[email protected]> wrote: > Hi, > > I'm a bit confused with stateless pages and maybe somebody can shed light on > this... > I have a (currently) empty mounted WebPage that is later supposed to serve > as a > health-check page and will thus be called frequently. Now, if a do a simple > wget > with the page URL, my RequestCycleListener tells me, that a new session was > created. > I use the following code for this check: > > if (((ServletWebRequest) > RequestCycle.get().getRequest()).getContainerRequest().getSession() > .isNew()) { > logger.info("New session started"); > } > > Now, since the page should not be bound to a session and will be called very > often, I would > rather not have the overhead of session creation for each request. Is there > something I am > missing? > > Jürgen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
