On Fri, Oct 15, 2010 at 1:25 AM, EC <chalanga.e...@gmail.com> wrote:

> Hi,
> I am trying to create a simple stateless app according to:
> https://cwiki.apache.org/WICKET/stateless-pages.html
> and the example in the source.
>
> Whenever I access this page, wicket tries to get an instance of
> javax.servlet.http.HttpSession. Our java server traps that and notifies via
> an exception.
> What is the way around it?
> Do I need to implement ISessionStore myself?
>
> Here is the source:
>
> public class MyApplication extends WebApplication {
> public Class getHomePage() {
> return HomePage.class;
> }
> @Override
> protected void init() {
> super.init();
> getResourceSettings().setResourcePollFrequency(null);
> }
> @Override
> protected ISessionStore newSessionStore() {
> return new HttpSessionStore(this);
> }
> }
> public class HomePage extends WebPage {
> public HomePage() {
> add(new Label("label", new Model("Hello, World")));
> }
> }
>
> <html>
> <body>
> <h1 wicket:id='label'>HELLO</h1>
> </body>
> </html>
>

The session is always going to be created for every request (stateless or
not).  But, if the session wasn't bound during the request, it is temporary
and thrown away at the end of the request.

-- 
Jeremy Thomerson
http://www.wickettraining.com

Reply via email to