If I log from MySession.get(), I observe the session changing between
requests. For a given request, the session seems stable, but it looks
like every request gets a new session. If I reload a page, I get a
new session.
On Sat, Aug 23, 2008 at 11:47 AM, francisco treacy
<[EMAIL PROTECTED]> wrote:
> with that exact setup in my webapps, if i do something like
>
> public static MySession get() {
> logger.debug(Session.get());
> return (MySession) Session.get();
> }
>
> i always observe the same session in the logs, for any page that
> requests it ([EMAIL PROTECTED]). don't you? you mean
> newSession is called several times during the app's lifecycle?
>
> francisco
>
>
> 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]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]