You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bh...@actrix.gen.nz on 2011/09/02 08:18:23 UTC

1.5 equivalent of setRedirect(false); ?

Hi,

In 1.4, in a page constructor, we can call setRedirect(false);

What is the equivalent of this in Wicket 1.5?

The purpose of it is to avoid the creation of a new request. I am
aware of the consequences of doing this in 1.4, and I am prepared for
them in 1.5, too.

Many thanks.

Bernard

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


Re: 1.5 equivalent of setRedirect(false); ?

Posted by bh...@actrix.gen.nz.
Martin,

Thanks very much, got the idea!

Regards,

Bernard

On Fri, 2 Sep 2011 09:31:39 +0200, you wrote:

>Wicket automatically decides whether redirect is needed for the
>current request or not depending on the configured
>org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy and by
>comparing the current url with the one that the IRequestMapper has
>generated for the page that is going to be rendered.
>I.e. if the current is: /my/mount/point and the page is stateful then
>the new url should be /my/mount/point?0 and Wicket will need to do a
>redirect. Otherwise Refresh button wont work, or at least wont refresh
>the current page but will create a new one. If you need to always
>create a new one then better make your page stateless or map this page
>with a custom IRequestMapper based on the default MountedMapper but
>not producing ?0.
>
>On Fri, Sep 2, 2011 at 8:18 AM,  <bh...@actrix.gen.nz> wrote:
>> Hi,
>>
>> In 1.4, in a page constructor, we can call setRedirect(false);
>>
>> What is the equivalent of this in Wicket 1.5?
>>
>> The purpose of it is to avoid the creation of a new request. I am
>> aware of the consequences of doing this in 1.4, and I am prepared for
>> them in 1.5, too.
>>
>> Many thanks.
>>
>> Bernard
>>
>> ---------------------------------------------------------------------
>> 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: 1.5 equivalent of setRedirect(false); ?

Posted by Martin Grigorov <mg...@apache.org>.
Wicket automatically decides whether redirect is needed for the
current request or not depending on the configured
org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy and by
comparing the current url with the one that the IRequestMapper has
generated for the page that is going to be rendered.
I.e. if the current is: /my/mount/point and the page is stateful then
the new url should be /my/mount/point?0 and Wicket will need to do a
redirect. Otherwise Refresh button wont work, or at least wont refresh
the current page but will create a new one. If you need to always
create a new one then better make your page stateless or map this page
with a custom IRequestMapper based on the default MountedMapper but
not producing ?0.

On Fri, Sep 2, 2011 at 8:18 AM,  <bh...@actrix.gen.nz> wrote:
> Hi,
>
> In 1.4, in a page constructor, we can call setRedirect(false);
>
> What is the equivalent of this in Wicket 1.5?
>
> The purpose of it is to avoid the creation of a new request. I am
> aware of the consequences of doing this in 1.4, and I am prepared for
> them in 1.5, too.
>
> Many thanks.
>
> Bernard
>
> ---------------------------------------------------------------------
> 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