[opencms-dev] Re: Declare http status (404/301/...) in JSP

Martin van den Bemt mvdb at ibl-software.nl
Tue Nov 22 10:47:22 CET 2005


It seems to me it's got the do with this entry in the web.xml :
     <error-page>
         <error-code>404</error-code>
         <location>/opencms/handle404</location>
     </error-page>
If the handle404 cannot find a resource it probably is just not sending 
a 404 to the browser, just a page saying that the resource is not found 
(afaik)..
So in my view, the 404handler in opencms needs fixing.

Mvgr,
Martin

Thorsten Duhn wrote:
> Hello,
> 
>> I think its generally impossible to modify the Header of the top level 
>> response.
> 
> 
> so why does "sendRedirect()" work as expected? This relies on
> sending a 301 status to the browser which then requests the
> redirect-to url also sent.
> 
>> Eg when you want to send a status-code, set the content type of the 
>> repsonse or sth else. Am I right?
> 
> 
> Could you be a bit more specific? I cannot use "setStatus()"
> but "sendRedirect()" works? I've also seen "setHeader()"
> working for additional cache settings. As I see it, all are
> part of the same API*, so it's OpenCms that ignores one value
> while executing the other one. Btw. "sendError()" does not
> work either.
> 
> Maybe I just haven't found the page in documentation saying
> me that some work (as I can read in "Advanced JSP topics" for
> "sendRedirect()") and other don't (as for "<jsp:forward").
> But even if documented, I still believe this is a major
> issue.
> 
> Regards,
> Thorsten
> 
> * http://java.sun.com/products/servlet/2.2/javadoc/index.html
>   > HttpServletResponse
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 



More information about the opencms-dev mailing list