Hi,Many thanks for the information - very useful. Turns out there seems to be an issue with C2.2 when setting the status of 404 inside map:handle-errors. This only occurs when setting the 404 in map:handle-errors and when the error is thrown inside a matcher.
Despite your explanation of the response handling process I still couldn't see why a 200 gets returned rather than the 404. It looked to me like ultimately the wrapped response did have its status code set to 404, and I couldn't find anywhere down the stack where it was changed or reset.
I've raised an issue on jira[1], along with a block that illustrates the issue if you're interested. Hopefully someone with more knowledge of Cocoon's internals will be able to take a look.
Thanks again, Robin [1] https://issues.apache.org/jira/browse/COCOON-2218 On 3 Jul 2008, at 01:36, [EMAIL PROTECTED] wrote:
On 7/2/08, Robin Wyles <[EMAIL PROTECTED]> wrote:When I try to set the response code to 404 from within a generator it hashttp://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon- servlet-service/cocoon-servlet-service-impl/src/main/java/org/ apache/cocoon/servletservice/ HttpServletResponseBufferingWrapper.java?view=markupno effect, i.e a 200 is still returned. It seems that HttpServletResponseBufferingWrapper[1] blocks this status code and doesn't set it on the wrapped HttpServletResponse. Is this by design? Thanks, Robin [1]=== Hi Robin, I checked that a similar issue from before my time (Cocoon-2.1.6) and fixed in Cocoon-2.1.11 does not apply to the 2.2.0 release. The bug http://issues.apache.org/bugzilla/show_bug.cgi?id=32336 has disappeared from Bugzilla. Understanding the process may help.org.apache.cocoon.components.treeprocessor.sitemap.SerializeNodeBuilde rResolves the status-code if a variable. Creates SerializeNode. org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode Verifies status-code is an Integer. Calls Environment.setStatus(int) org.apache.cocoon.environment.Environment wrapper for HttpEnvironment org.apache.cocoon.environment.http.HttpEnvironment Calls HttpResponse.setStatus(int) HttpServletResponseBufferingWrapper implements this function with a bypass based on isCommitted(). Try removing the bypass and see if the status-code is set properly (for troubleshooting, not as a permanent change.) HTH, solprovider --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature