res.sendError(404,
843836Dec 11 2004 — edited Dec 11 2004Hi
I have given a code snippet here. As per my understanding, if I pass a null value for name, send error method will be called and then response will be committed. It will show "Illegal State Exception", when the next line is executed. but i can see only 404 msg and dont get exception. Any one can explain me this ?
public void doGet(HttpServletRequest req,HttpServletResponse res)throws IOException,ServletException
{
String name=null;
PrintWriter out = res.getWriter();
out.println("hello ");
if (name==null)
{
res.sendError(404,"SCWCD3");
}
out.println(name);
}