Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

res.sendError(404,

843836Dec 11 2004 — edited Dec 11 2004
Hi
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);

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2005
Added on Dec 11 2004
1 comment
130 views