wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ziegler, Christian" <christian.zieg...@pentasys.de>
Subject AW: Redirect within a RequestCycleListener's onBeginRequest
Date Thu, 29 Aug 2013 07:33:52 GMT
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.


Von: Ziegler, Christian [christian.ziegler@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();

which also didn't work.

Any ideas?


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

View raw message