You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Neil Curzon (Commented) (JIRA)" <ji...@apache.org> on 2012/03/05 23:23:59 UTC

[jira] [Commented] (WICKET-4433) Exception (Header was already written to response!) when setting response page in IRequestCycleListener

    [ https://issues.apache.org/jira/browse/WICKET-4433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222676#comment-13222676 ] 

Neil Curzon commented on WICKET-4433:
-------------------------------------

When I implement your solution in my attached quickstart, I do indeed get redirected to PageTwo, but the entirety of the page is written out twice.

When I implement it in my application, nothing happens (the constructor for the other page doesn't fire and I just end up on the page I started at).


                
> Exception (Header was already written to response!) when setting response page in IRequestCycleListener
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4433
>                 URL: https://issues.apache.org/jira/browse/WICKET-4433
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>            Reporter: Neil Curzon
>         Attachments: myproject.zip, myproject.zip
>
>
> We have an IRequestCycleListener implementation that's basically:
> 	@Override
> 	public void onBeginRequest(RequestCycle cycle) {
> 		if (<condition>)) {
> 			cycle.setResponsePage(SpecificPage.class);
> 		}
> 	}
> This results in an exception when the condition is true, and the response page is set:
> java.lang.IllegalStateException: Header was already written to response!
> 	at org.apache.wicket.protocol.http.HeaderBufferingWebResponse.checkHeader(HeaderBufferingWebResponse.java:64)
> 	at org.apache.wicket.protocol.http.HeaderBufferingWebResponse.setDateHeader(HeaderBufferingWebResponse.java:134)
> 	at org.apache.wicket.protocol.http.BufferedWebResponse$SetDateHeaderAction.invoke(BufferedWebResponse.java:310)
> 	at org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:580)
> 	at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:185)
> 	at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
> 	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
> 	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
> 	at org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:304)
> 	at org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:313)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira