You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bertrand Guay-Paquet <be...@step.polymtl.ca> on 2011/09/13 23:59:55 UTC

stateless page + click on stateless link = stateful page

Hello,

I have a stateless page with a stateless link on it. The stateless link 
is used to set the session locale and nothing more. In particular, it 
does not redirect to another page when clicked.

On first access to the page, the url is: localhost/servlet/login
After clicking on the stateless link, the url becomes something like: 
localhost/servlet/login?8-1.ILinkListener-userPanel-en

At this point, the page is now stateful. This is caused by the 
constructor PageProvider(IRequestablePage page) which has the following 
code:
     if (pageInstance instanceof Page)
     {
         ((Page)pageInstance).setStatelessHint(false);
     }

I don't understand why this is done. Is it because Wicket needs to make 
the page stateful since the URL now contains an action listener parameter?

Is there a way to prevent the stateless page from becoming stateful?

Cheers,
Bertrand

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


Re: stateless page + click on stateless link = stateful page

Posted by Pedro Santos <pe...@gmail.com>.
Yes, otherwise the F5 would not work. It can be prevented by redirecting to
a stateless page, even if it was the last accessed one.

2011/9/13 Bertrand Guay-Paquet <be...@step.polymtl.ca>

> Hello,
>
> I have a stateless page with a stateless link on it. The stateless link is
> used to set the session locale and nothing more. In particular, it does not
> redirect to another page when clicked.
>
> On first access to the page, the url is: localhost/servlet/login
> After clicking on the stateless link, the url becomes something like:
> localhost/servlet/login?8-1.**ILinkListener-userPanel-en
>
> At this point, the page is now stateful. This is caused by the constructor
> PageProvider(IRequestablePage page) which has the following code:
>    if (pageInstance instanceof Page)
>    {
>        ((Page)pageInstance).**setStatelessHint(false);
>    }
>
> I don't understand why this is done. Is it because Wicket needs to make the
> page stateful since the URL now contains an action listener parameter?
>
> Is there a way to prevent the stateless page from becoming stateful?
>
> Cheers,
> Bertrand
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: stateless page + click on stateless link = stateful page

Posted by Martin Grigorov <mg...@apache.org>.
The issue is WICKET-3991.

On Wed, Sep 14, 2011 at 6:00 PM, Bertrand Guay-Paquet
<be...@step.polymtl.ca> wrote:
> Thank you for your answers.
>
> Indeed, "setResponsePage(getPage());" will also result in a stateful page.
>
> I did the following to workaround the issue for now since the panel
> containing the stateless link appears on all pages of my site:
>    Page page = getPage();
>    if (page.isStateless())
>        // Creates a new stateless page instance
>        setResponsePage(page.getClass());
>    else
>        setResponsePage(page);
>
> Martin, is WICKET-4046 <https://issues.apache.org/jira/browse/WICKET-4046>
> the issue you mentioned for this?
>
> On 14/09/2011 3:50 AM, Martin Grigorov wrote:
>>
>> Indeed this change was reverted after RC7.
>> Now only "setResponsePage(new StatelessPage());" is automatically
>> promoted to stateful.
>>
>> We tried to make it more general but apparently it was wrong...
>>
>> On Wed, Sep 14, 2011 at 9:06 AM, Mike Mander<wi...@gmx.de>  wrote:
>>>
>>> Am 13.09.2011 23:59, schrieb Bertrand Guay-Paquet:
>>>>
>>>> This is fixed in trunk. The fix will be available in 1.5.1
>>>
>>> Martin wrote to me in a former post
>>>>
>>>> This is fixed in trunk. The fix will be available in 1.5.1
>>>
>>> Maybe we should try it again with 1.5.1
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: stateless page + click on stateless link = stateful page

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Thank you for your answers.

Indeed, "setResponsePage(getPage());" will also result in a stateful page.

I did the following to workaround the issue for now since the panel 
containing the stateless link appears on all pages of my site:
     Page page = getPage();
     if (page.isStateless())
         // Creates a new stateless page instance
         setResponsePage(page.getClass());
     else
         setResponsePage(page);

Martin, is WICKET-4046 
<https://issues.apache.org/jira/browse/WICKET-4046> the issue you 
mentioned for this?

On 14/09/2011 3:50 AM, Martin Grigorov wrote:
> Indeed this change was reverted after RC7.
> Now only "setResponsePage(new StatelessPage());" is automatically
> promoted to stateful.
>
> We tried to make it more general but apparently it was wrong...
>
> On Wed, Sep 14, 2011 at 9:06 AM, Mike Mander<wi...@gmx.de>  wrote:
>> Am 13.09.2011 23:59, schrieb Bertrand Guay-Paquet:
>>> This is fixed in trunk. The fix will be available in 1.5.1
>> Martin wrote to me in a former post
>>> This is fixed in trunk. The fix will be available in 1.5.1
>> Maybe we should try it again with 1.5.1
>>
>> ---------------------------------------------------------------------
>> 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: stateless page + click on stateless link = stateful page

Posted by Martin Grigorov <mg...@apache.org>.
Indeed this change was reverted after RC7.
Now only "setResponsePage(new StatelessPage());" is automatically
promoted to stateful.

We tried to make it more general but apparently it was wrong...

On Wed, Sep 14, 2011 at 9:06 AM, Mike Mander <wi...@gmx.de> wrote:
> Am 13.09.2011 23:59, schrieb Bertrand Guay-Paquet:
>>
>> This is fixed in trunk. The fix will be available in 1.5.1
>
> Martin wrote to me in a former post
>> This is fixed in trunk. The fix will be available in 1.5.1
> Maybe we should try it again with 1.5.1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: stateless page + click on stateless link = stateful page

Posted by Mike Mander <wi...@gmx.de>.
Am 13.09.2011 23:59, schrieb Bertrand Guay-Paquet:
> This is fixed in trunk. The fix will be available in 1.5.1
Martin wrote to me in a former post
 > This is fixed in trunk. The fix will be available in 1.5.1
Maybe we should try it again with 1.5.1

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