HTTPServletResponse.setStatus and error page

reformy_at_gmail.com
Date: 02/28/05


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



Relevant Pages

  • Re: Learning Assembly with an HLL
    ... unavoidable API stuff. ... it more difficult to comprehend why you would recommend INVOKE. ... bytes and that the 32 bytes at top of stack must be available ... If the assembler doesn't know where the scratch space in the ...
    (comp.lang.asm.x86)
  • Re: App "Freezes" when getting atom feed
    ... Are you doing this in response to a UI event, ... The method will then invoke the delegate passed in and then ... the content of those blogs using Atomizer. ... Atom atom = Atom.Create, generator, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Converting char(s) into String
    ... Perhaps because it depends on knowledge of the API. ... If the compiler produced code using StringBuffer ... invoke 0 parameter constructor of StringBuffer. ... invoke 1 parameter append method. ...
    (comp.lang.java.programmer)
  • Calling Web Service with axis freezes application
    ... I have problems invoking a Web Service with AXIS. ... After trying a few times I opened TCP Monitor to check communication. ... I see the response coming in, ... By the way, I have another tool to invoke the same request, which works ...
    (comp.lang.java.programmer)
  • Accessing SAP WAS via SOAP / xml-namespace problem
    ... the problem is, it works fine with one server, i.e. after calling ... 'invoke' in the proxyclass, I get an object arry with two non-null ... the only difference is the namespace handling in the two returned ... elements, and there are no siblings to this response element, so there ...
    (microsoft.public.dotnet.xml)