sendError « Tomcat « JSP-Servlet Q&A





1. how can i retrieve the msg from HttpServletResponse.sendError    stackoverflow.com

i have two tomcat servers that communicate between them. upon an error at one of the servers i would like to send an error response to the other server. i am sending ...

2. tomcat does not show error message when sendError used from servlet    stackoverflow.com

Ok so I have a pretty simple webapp using a Servlet and in some cases I send and error back to the client like:

response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Did not specify parameter xyz");
This works fine ...

3. [Tomcat bug?] Calling response.sendError(404) from JSP    forums.oracle.com

When you send error response codes etc. you should do so before anything is written to the output stream, which basically means you should do it from a servlet or filter without invoking a JSP. People use JSPs to do a lot of stuff they're unsuited to. JSPs should just format HTML after all the decisions and validation has been done. ...