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

Thorsten Duhn duhn at regio.uni-oldenburg.de
Tue Nov 22 10:33:51 CET 2005


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




More information about the opencms-dev mailing list