Hi all,
i have some problems to understand the redirecting mechanism of wicket.
When i try something like this:
public class Testing extends WebPage {
public Testing() {
add(new Link("go") {
public void onClick() {
getResponse().redirect("/");
}
});
}
}
I get that:
javax.servlet.ServletException: Internal Error: Could not redirect to
exception error page. Was trying to display exception for page [Page
class = Testing, id = 0]:
wicket.WicketRuntimeException: Already redirecting to '/'. Cannot
redirect more than once
at
wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:96)
at
wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:249)
at wicket.RequestCycle.respond(RequestCycle.java:771)
at wicket.RequestCycle.request(RequestCycle.java:406)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:304)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:145)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
...
So i found out that response.redirect should not be used by the user
(btw: why isn't it private when it should not be used?).
Then i found out you can redirect with
setResponsePage(new RedirectPage("/"));
But the problem is that there is a HTML-Page with a Meta-Refresh send.
Is there a possibility to use HTTP-Header Location with wicket?
Thanks,
Dave
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user