Sven,

thanks for the input! I will look into that. At a first glance it looks 
promising.

Regards,
Chris

________________________________________
Von: Sven Meier [s...@meiers.net]
Gesendet: Donnerstag, 29. August 2013 11:08
An: users@wicket.apache.org
Betreff: Re: AW: Redirect within a RequestCycleListener's onBeginRequest

Hi,

RedirectToUrlException is a ReplaceHandlerException, which is handled in
RequestHandlerStack#execute() only (which is called after the listeners
have been notified).

 > In onBeginRequest im throwing a custom runtime exception which I
handle in onException
 > by returning a RedirectRequestHandler.

Yeah, that works. Alternatively you might look into implementing your
own IRequestMapper.

Have fun
Sven

On 08/29/2013 09:33 AM, Ziegler, Christian wrote:
> Hi again,
>
> for documentation purposes, it seems I found a way. In onBeginRequest im 
> throwing a custom runtime exception which I handle in onException by 
> returning a RedirectRequestHandler.
>
> Regards,
> Chris
>
> ________________________________________
> Von: Ziegler, Christian [christian.zieg...@pentasys.de]
> Gesendet: Dienstag, 27. August 2013 18:04
> An: users@wicket.apache.org
> Betreff: Redirect within a RequestCycleListener's onBeginRequest
>
> Hi all,
>
> I'm trying implement a RequestCycleListener which redirects the user to the 
> same page he initially requested but which adds a query string parameter in 
> certain cases. It has to be a redirect response since the parameter is 
> interpreted by an external system before it's forwarded to my application. In 
> onBeginRequest i tried
>
> public void onBeginRequest(RequestCycle cycle) {
>      throw new RedirectToUrlException("http://test?bla=true";);
> }
>
> which didn't work. Then tried altering the Response object obtained from the 
> RequestCycle object like
>
> public void onBeginRequest(RequestCycle cycle) {
>      WebResponse response = (WebResponse) cycle.getResponse();
>      response.sendRedirect("http://test?bla=true";);
> }
>
> which also didn't work.
>
> Any ideas?
>
> Cheers,
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


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


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

Reply via email to