On 7/2/08, Robin Wyles <[EMAIL PROTECTED]> wrote: > When I try to set the response code to 404 from within a generator it has > no 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] http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/HttpServletResponseBufferingWrapper.java?view=markup ===
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.SerializeNodeBuilder Resolves 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]