This brings up a related issue... Is there a more elegant way for us to handle the case where an exception occurs after the response stream has been written to?

That is, if we flushed some data into the output, an exception occurs, Wicket currently redirects to the error page but (as far as I recall) the browser does not display it and worse yet sometimes it just "hangs" there waiting for more data. I suspect that the browser is expecting some content-length and we stop prematurely sending it data (from its point of view) so it is just sitting there. This is just a guess and I could be wrong.

Is there a more elegant way for us to handle this to cause the browser to fail-fast (not hang there) and if possible redirect to the error page somehow (I doubt the latter is possible)?

Gili

Juergen Donnerstag wrote:
Update of /cvsroot/wicket/wicket/src/java/wicket/request/compound
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7124/src/java/wicket/request/compound

Modified Files:
DefaultExceptionResponseStrategy.java Log Message:
don't redirect to the error page in case the exception occured during the page 
constructor. This allows, in case of a markup error, to correct the markup and 
press the browser refresh button to reload the page.

Index: DefaultExceptionResponseStrategy.java
===================================================================
RCS file: 
/cvsroot/wicket/wicket/src/java/wicket/request/compound/DefaultExceptionResponseStrategy.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DefaultExceptionResponseStrategy.java       17 Feb 2006 20:51:27 -0000      
1.8
--- DefaultExceptionResponseStrategy.java       20 Feb 2006 21:09:24 -0000      
1.9
***************
*** 52,56 ****
         *      java.lang.RuntimeException)
         */
!       public final void respond(RequestCycle requestCycle, RuntimeException e)
        {
                // If application doesn't want debug info showing up for users
--- 52,56 ----
         *      java.lang.RuntimeException)
         */
!       public final void respond(final RequestCycle requestCycle, final 
RuntimeException e)
        {
                // If application doesn't want debug info showing up for users
***************
*** 64,68 ****
                {
                        requestCycle.setResponsePage(override);
-                       requestCycle.setRedirect(true);
                }
                else if (settings.getUnexpectedExceptionDisplay() != 
IExceptionSettings.SHOW_NO_EXCEPTION_PAGE)
--- 64,67 ----
***************
*** 91,96 ****
                        {
                                // Show full details
!                               requestCycle.setResponsePage(new 
ExceptionErrorPage(e, requestCycle
!                                               .getResponsePage()));
                        }
                        else
--- 90,94 ----
                        {
                                // Show full details
!                               requestCycle.setResponsePage(new 
ExceptionErrorPage(e, responsePage));
                        }
                        else
***************
*** 100,107 ****
                                                + internalErrorPageClass, e);
                        }
! // We generally want to redirect the response because we
!                       // were in the middle of rendering and the page may end 
up
!                       // looking like spaghetti otherwise
                        requestCycle.setRedirect(true);
                }
--- 98,111 ----
                                                + internalErrorPageClass, e);
                        }
+               }
! // We generally want to redirect the response because we
!               // were in the middle of rendering and the page may end up
!               // looking like spaghetti otherwise. If responsePage == null,
!               // than the Page constructor failed and we don't need to
!               // redirect and this allows to reload the page when the
!               // bug has been fixed.
!               if (responsePage != null)
!               {
                        requestCycle.setRedirect(true);
                }
***************
*** 124,128 ****
         * @return Any error page to redirect to
         */
!       protected Page onRuntimeException(Page page, RuntimeException e)
        {
                return RequestCycle.get().onRuntimeException(page, e);
--- 128,132 ----
         * @return Any error page to redirect to
         */
!       protected Page onRuntimeException(final Page page, final 
RuntimeException e)
        {
                return RequestCycle.get().onRuntimeException(page, e);



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-autocvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-autocvs


--
http://www.desktopbeautifier.com/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to