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

Peter Ertl commented on WICKET-3031:
------------------------------------

@Igor: When the form of the sample you mentioned is submitted and the submit 
listener is invoked a render page action is scheduled for execution after 
current. While processing the form submit an exception is caught and the 
exception handler is mapped. The error page handler is getting processed. Since 
exception handlers do not redirect anymore by default (to keep the current url 
visible) the error page is rendered directly under the same url. After the 
error page was rendered and sent to the client the previous page handler is 
still queued for rendering. Once rendering starts again you get:

  java.lang.IllegalStateException: Header was already written to response! 

Fix: Before executing the error page, clear any scheduled request handlers. 
There is no reason to render anything after(!) an error page.

See class RequestCycle, line 274 (commit #992874) for change



> Problem with date headers on error pages
> ----------------------------------------
>
>                 Key: WICKET-3031
>                 URL: https://issues.apache.org/jira/browse/WICKET-3031
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5-M1
>            Reporter: Igor Vaynberg
>            Assignee: Peter Ertl
>             Fix For: 1.5-M2
>
>
> when an error page is displayed the error below occurs. use quickstart in 
> WICKET-3030 or any other way to cause an error to reproduce
> ERROR - RequestCycle               - Error during processing error message
> java.lang.IllegalStateException: Header was already written to response!
>       at 
> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.checkHeader(HeaderBufferingWebResponse.java:62)
>       at 
> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.setDateHeader(HeaderBufferingWebResponse.java:131)
>       at 
> org.apache.wicket.protocol.http.BufferedWebResponse$SetDateHeaderAction.invoke(BufferedWebResponse.java:193)
>       at 
> org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:439)
>       at 
> org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:203)
>       at 
> org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:147)
>       at 
> org.apache.wicket.request.RequestHandlerStack.executeRequestHandler(RequestHandlerStack.java:84)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:276)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:285)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:232)
>       at 
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:258)
>       at 
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:135)
>       at 
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:188)
>       at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>       at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>       at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>       at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>       at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>       at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>       at org.mortbay.jetty.Server.handle(Server.java:295)
>       at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
>       at 
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
>       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
>       at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>       at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>       at 
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
>       at 
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to