Your application consists currently of only stateless pages. Wicket
will try to remain stateless until it is necessary, and keep
creating/discarding session objects until a stateful page comes along
(or rather, a session relative URL).

Read [1] for more information.

Martijn

[1] http://www.nabble.com/Status-of-Delayed-Session-Creation-td10999236.html

On Sat, Aug 23, 2008 at 7:48 PM, nate roe <[EMAIL PROTECTED]> wrote:
> I've created a new Wicket application following the session creation
> pattern illustrated in Wicket in Action, but for reasons not obvious
> to me, every web request returns an entirely new session.
>
> This is my application:
>
> public class MyApplication extends WebApplication {
>        Logger logger = Logger.getLogger(MyApplication.class);
>
>        public MyApplication() {
>                mountBookmarkablePage("verify", VerificationPage.class);
>                mountBookmarkablePage("register", RegistrationPage.class);
>        }
>
>        public Class getHomePage() {
>                return LoginPage.class;
>        }
>
>        @Override
>        public Session newSession(Request request, Response response) {
>                logger.debug("new session!");
>
>                return new MySession(request);
>        }
> }
>
>
> And this is my session:
>
> public class MySession extends WebSession {
>
>        private static final long serialVersionUID = 1L;
>
>        private Account account;
>
>        public MySession(Request request) {
>                super(request);
>                setLocale(Locale.ENGLISH);
>        }
>
>        public static MySession get() {
>                return (MySession) Session.get();
>        }
>
>        public boolean isAuthenticated() {
>                return account != null;
>        }
>
>        public Account getAccount() {
>                return account;
>        }
>
>        public void setAccount(Account account) {
>                this.account = account;
>        }
> }
>
> What have I done wrong?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to