You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by kamiseq <ka...@gmail.com> on 2012/05/21 09:56:37 UTC

wicket 6 setting response page with page object and session expired error

hej,
I have a strange error.

I have stateless page (A) with form on it. form contains email input.
inside form's onSelect handler I create page (B) and pass email to its
constructor.
  Application nextPage = new
Application(getModelObject().getEmail());// form model object
  setResponsePage(nextPage);

page B is also mounted so someone can access page by passing email as parameter.
  super(parameters);
  StringValue email = parameters.get("email");
  if (email.isEmpty())
    throw new RuntimeException("uoooops no email");

page B displays users data if available.
page B creates LoadableDetachableModel and uses email as id, I also
pass Injected service object by giuce to the model
page B has link to go to page C
add(new Link<Void>("accept")
{
    @Override
    public void onClick() {
        SignIn signInPage = new SignIn(model); // model is created on
the begging of the constructor
        setResponsePage(signInPage);
    }
});

pages B and C are state-full.
now when I go from page A and pass page B object and then call the
link which creates page C object then I get page expired message.
BUT if I go directly to page B using mounted url and then I click on
link I am redirected to page C without a problem.

maybe I miss something obvious here but I cannot explain it why this
is happening.
there is no errors in log from wicket, the SignIn (C) page is created
as expected.

thanks for any hint.

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
i checked it on other machine, and is working, I ve cleaned m2
repository and now it is working as well :/
I dont know what happened but it is weird that it showed on two
separate application

thanks for help, actually it is great it was only may problem ;]

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 22 May 2012 22:52, kamiseq <ka...@gmail.com> wrote:
> but why??
> test it with mvn clean install jetty:run
>
> pozdrawiam
> Paweł Kamiński
>
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
>
>
> On 22 May 2012 20:47, Thomas Götz <to...@decoded.de> wrote:
>> I tested your quickstart from within the IDE by running Start.java.
>>
>> Models are meant to be passed around, so there's nothing wrong with it in general. And it's always (at least in >95% of cases I'd dare to say) preferable to passing Objects (beans).
>>
>>
>>   -Tom
>>
>>
>> On 22.05.2012 at 18:55 kamiseq wrote:
>>
>>> anyway there is nothing wrong to my code, in your opnion?
>>> I just have bad feeling about passing model from one page to another
>>> in constructor. on the other hand model are serialised into session so
>>> maybe it is a better idea to pass them around rather than object they
>>> are wrapping
>>>
>>> pozdrawiam
>>> Paweł Kamiński
>>>
>>> kamiseq@gmail.com
>>> pkaminski.prv@gmail.com
>>> ______________________
>>>
>>>
>>> On 22 May 2012 18:13, kamiseq <ka...@gmail.com> wrote:
>>>> huh, then something is wrong with my environment,
>>>> im running it with jetty invoking simple mvn clean install jetty:run
>>>>
>>>> pozdrawiam
>>>> Paweł Kamiński
>>>>
>>>> kamiseq@gmail.com
>>>> pkaminski.prv@gmail.com
>>>> ______________________
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
but why??
test it with mvn clean install jetty:run

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 22 May 2012 20:47, Thomas Götz <to...@decoded.de> wrote:
> I tested your quickstart from within the IDE by running Start.java.
>
> Models are meant to be passed around, so there's nothing wrong with it in general. And it's always (at least in >95% of cases I'd dare to say) preferable to passing Objects (beans).
>
>
>   -Tom
>
>
> On 22.05.2012 at 18:55 kamiseq wrote:
>
>> anyway there is nothing wrong to my code, in your opnion?
>> I just have bad feeling about passing model from one page to another
>> in constructor. on the other hand model are serialised into session so
>> maybe it is a better idea to pass them around rather than object they
>> are wrapping
>>
>> pozdrawiam
>> Paweł Kamiński
>>
>> kamiseq@gmail.com
>> pkaminski.prv@gmail.com
>> ______________________
>>
>>
>> On 22 May 2012 18:13, kamiseq <ka...@gmail.com> wrote:
>>> huh, then something is wrong with my environment,
>>> im running it with jetty invoking simple mvn clean install jetty:run
>>>
>>> pozdrawiam
>>> Paweł Kamiński
>>>
>>> kamiseq@gmail.com
>>> pkaminski.prv@gmail.com
>>> ______________________
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by Thomas Götz <to...@decoded.de>.
I tested your quickstart from within the IDE by running Start.java.

Models are meant to be passed around, so there's nothing wrong with it in general. And it's always (at least in >95% of cases I'd dare to say) preferable to passing Objects (beans).


   -Tom


On 22.05.2012 at 18:55 kamiseq wrote:

> anyway there is nothing wrong to my code, in your opnion?
> I just have bad feeling about passing model from one page to another
> in constructor. on the other hand model are serialised into session so
> maybe it is a better idea to pass them around rather than object they
> are wrapping
> 
> pozdrawiam
> Paweł Kamiński
> 
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
> 
> 
> On 22 May 2012 18:13, kamiseq <ka...@gmail.com> wrote:
>> huh, then something is wrong with my environment,
>> im running it with jetty invoking simple mvn clean install jetty:run
>> 
>> pozdrawiam
>> Paweł Kamiński
>> 
>> kamiseq@gmail.com
>> pkaminski.prv@gmail.com
>> ______________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
anyway there is nothing wrong to my code, in your opnion?
I just have bad feeling about passing model from one page to another
in constructor. on the other hand model are serialised into session so
maybe it is a better idea to pass them around rather than object they
are wrapping

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 22 May 2012 18:13, kamiseq <ka...@gmail.com> wrote:
> huh, then something is wrong with my environment,
> im running it with jetty invoking simple mvn clean install jetty:run
>
> pozdrawiam
> Paweł Kamiński
>
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
huh, then something is wrong with my environment,
im running it with jetty invoking simple mvn clean install jetty:run

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by Thomas Götz <to...@decoded.de>.
On 22.05.2012 at 06:01 kamiseq wrote:

> step to reproduce
> 1. go to http://localhost:8080 and type any valid email (ie lw@oa.pl)
> and submit form
> 2. press accept and it will take you to third page
> 3. this should fail and show expire page error

No, it doesn't. 3. works in your example, there is no exception thrown.


> 1. go to http://localhost:8080/user/email/lw@oa.pl
> 2. press accept
> 3. third page is loaded as expected

Confirmed, but I can see no difference in the behavior of that two processes, both work for me in your provided quickstart.

   -Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
ok,
I try to send it as attachment.
it is maven based project.

step to reproduce
1. go to http://localhost:8080 and type any valid email (ie lw@oa.pl)
and submit form
2. press accept and it will take you to third page
3. this should fail and show expire page error

1. go to http://localhost:8080/user/email/lw@oa.pl
2. press accept
3. third page is loaded as expected

I hope I am not doing something stupid here ;]

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 21 May 2012 16:57, kamiseq <ka...@gmail.com> wrote:
> ok,
> yep right, give me some time so I try to recreate it from scratch
>
> pozdrawiam
> Paweł Kamiński
>
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
>
>
> On 21 May 2012 16:48, Thomas Götz <to...@decoded.de> wrote:
>> Either this or upload it somewhere and post the link here.
>>
>>   -Tom
>>
>>
>> On 21.05.2012 at 16:25 kamiseq wrote:
>>
>>> yes,
>>> can I send it directly to you in case userlist rejects attachment?
>>>
>>> pozdrawiam
>>> Paweł Kamiński
>>>
>>> kamiseq@gmail.com
>>> pkaminski.prv@gmail.com
>>> ______________________
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>

Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
ok,
yep right, give me some time so I try to recreate it from scratch

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 21 May 2012 16:48, Thomas Götz <to...@decoded.de> wrote:
> Either this or upload it somewhere and post the link here.
>
>   -Tom
>
>
> On 21.05.2012 at 16:25 kamiseq wrote:
>
>> yes,
>> can I send it directly to you in case userlist rejects attachment?
>>
>> pozdrawiam
>> Paweł Kamiński
>>
>> kamiseq@gmail.com
>> pkaminski.prv@gmail.com
>> ______________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by Thomas Götz <to...@decoded.de>.
Either this or upload it somewhere and post the link here.

   -Tom


On 21.05.2012 at 16:25 kamiseq wrote:

> yes,
> can I send it directly to you in case userlist rejects attachment?
> 
> pozdrawiam
> Paweł Kamiński
> 
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by kamiseq <ka...@gmail.com>.
yes,
can I send it directly to you in case userlist rejects attachment?

pozdrawiam
Paweł Kamiński

kamiseq@gmail.com
pkaminski.prv@gmail.com
______________________


On 21 May 2012 10:01, Thomas Götz <to...@decoded.de> wrote:
> Could you provide a quickstart that demonstrates this behavior?
>
>   -Tom
>
>
> On 21.05.2012 at 09:56 kamiseq wrote:
>
>> hej,
>> I have a strange error.
>>
>> I have stateless page (A) with form on it. form contains email input.
>> inside form's onSelect handler I create page (B) and pass email to its
>> constructor.
>>  Application nextPage = new
>> Application(getModelObject().getEmail());// form model object
>>  setResponsePage(nextPage);
>>
>> page B is also mounted so someone can access page by passing email as parameter.
>>  super(parameters);
>>  StringValue email = parameters.get("email");
>>  if (email.isEmpty())
>>    throw new RuntimeException("uoooops no email");
>>
>> page B displays users data if available.
>> page B creates LoadableDetachableModel and uses email as id, I also
>> pass Injected service object by giuce to the model
>> page B has link to go to page C
>> add(new Link<Void>("accept")
>> {
>>    @Override
>>    public void onClick() {
>>        SignIn signInPage = new SignIn(model); // model is created on
>> the begging of the constructor
>>        setResponsePage(signInPage);
>>    }
>> });
>>
>> pages B and C are state-full.
>> now when I go from page A and pass page B object and then call the
>> link which creates page C object then I get page expired message.
>> BUT if I go directly to page B using mounted url and then I click on
>> link I am redirected to page C without a problem.
>>
>> maybe I miss something obvious here but I cannot explain it why this
>> is happening.
>> there is no errors in log from wicket, the SignIn (C) page is created
>> as expected.
>>
>> thanks for any hint.
>>
>> pozdrawiam
>> Paweł Kamiński
>>
>> kamiseq@gmail.com
>> pkaminski.prv@gmail.com
>> ______________________
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 6 setting response page with page object and session expired error

Posted by Thomas Götz <to...@decoded.de>.
Could you provide a quickstart that demonstrates this behavior?

   -Tom


On 21.05.2012 at 09:56 kamiseq wrote:

> hej,
> I have a strange error.
> 
> I have stateless page (A) with form on it. form contains email input.
> inside form's onSelect handler I create page (B) and pass email to its
> constructor.
>  Application nextPage = new
> Application(getModelObject().getEmail());// form model object
>  setResponsePage(nextPage);
> 
> page B is also mounted so someone can access page by passing email as parameter.
>  super(parameters);
>  StringValue email = parameters.get("email");
>  if (email.isEmpty())
>    throw new RuntimeException("uoooops no email");
> 
> page B displays users data if available.
> page B creates LoadableDetachableModel and uses email as id, I also
> pass Injected service object by giuce to the model
> page B has link to go to page C
> add(new Link<Void>("accept")
> {
>    @Override
>    public void onClick() {
>        SignIn signInPage = new SignIn(model); // model is created on
> the begging of the constructor
>        setResponsePage(signInPage);
>    }
> });
> 
> pages B and C are state-full.
> now when I go from page A and pass page B object and then call the
> link which creates page C object then I get page expired message.
> BUT if I go directly to page B using mounted url and then I click on
> link I am redirected to page C without a problem.
> 
> maybe I miss something obvious here but I cannot explain it why this
> is happening.
> there is no errors in log from wicket, the SignIn (C) page is created
> as expected.
> 
> thanks for any hint.
> 
> pozdrawiam
> Paweł Kamiński
> 
> kamiseq@gmail.com
> pkaminski.prv@gmail.com
> ______________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org