HTTPServletResponse.setStatus and error page
reformy_at_gmail.com
Date: 02/28/05
- Next message: Jacob: "Re: double declaration"
- Previous message: MS: "Re: 'dist' jar file doesn't work."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Feb 2005 03:49:18 -0800
hey
from the HTTPServletResponse.setStatus(int sc) API:
"Sets the status code for this response. This method is used to set the
return status code when there is no error (for example, for the status
codes SC_OK or SC_MOVED_TEMPORARILY). If there is an error, and the
caller wishes to invoke an error-page defined in the web application,
the sendError method should be used instead."
I understand from this, that the following code:
response.setStatus(SC_CONFLICT);
response.getOutputStream().println("<html><body>error</body></html>");
should NOT invoke the error page (i have an error page defined for
409-conflict in my web.xml). But still - i get the error page and not
what i've printed into the output-stream.
why?
thanks
yair
- Next message: Jacob: "Re: double declaration"
- Previous message: MS: "Re: 'dist' jar file doesn't work."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|