You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2010/08/27 01:35:04 UTC
svn commit: r989976 -
/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
Author: ivaynberg
Date: Thu Aug 26 23:35:03 2010
New Revision: 989976
URL: http://svn.apache.org/viewvc?rev=989976&view=rev
Log:
when handling errors revert the status back to 200 so browsers properly display the error page
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java?rev=989976&r1=989975&r2=989976&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Thu Aug 26 23:35:03 2010
@@ -118,6 +118,16 @@ public class WicketFilter implements Fil
HttpServletRequest httpServletRequest = (HttpServletRequest)request;
HttpServletResponse httpServletResponse = (HttpServletResponse)response;
+ if (!Strings.isEmpty((String)request.getAttribute("javax.servlet.error.request_uri")))
+ {
+ /*
+ * we are inside an error dispatch, because wicket assumes status is 200 and only
+ * sets statuses to non-200 conditions we reset the current error status (404 or
+ * other) back to 200
+ */
+ httpServletResponse.setStatus(HttpServletResponse.SC_OK);
+ }
+
// Make sure getFilterPath() gets called before checkIfRedirectRequired()
String filterPath = getFilterPath(httpServletRequest);