Author: ivaynberg Date: Thu Aug 26 23:32:09 2010 New Revision: 989975 URL: http://svn.apache.org/viewvc?rev=989975&view=rev Log: fix status of error dispatches
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java?rev=989975&r1=989974&r2=989975&view=diff ============================================================================== --- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java (original) +++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Thu Aug 26 23:32:09 2010 @@ -238,6 +238,7 @@ public class WicketFilter implements Fil public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + HttpServletRequest httpServletRequest; HttpServletResponse httpServletResponse; @@ -264,6 +265,14 @@ public class WicketFilter implements Fil 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); + } + // If we are a filter which is only meant to process requests in a portlet context, and we // are in fact not in a portlet context, stop processing now and pass to next filter in the // chain.