Servlet ,JSP IllegalstateException:
The IllegalstateException will occur if some code is exit after the response code.
Error Occur Code:
if(username.equals("bala2e")){
To avoid IllegalstateException by using following code.
By using the return statement we can avoid the this exception
The IllegalstateException will occur if some code is exit after the response code.
Error Occur Code:
if(username.equals("bala2e")){
respons.sendRedirect("bala2e.blogspot.com"); }else{ respons.sendRedirect("google.com"); }
To avoid IllegalstateException by using following code.
By using the return statement we can avoid the this exception
if(username.equals("bala2e")){ respons.sendRedirect("bala2e.blogspot.com"); return;//to avoid IllegalstateException }else{ respons.sendRedirect("google.com"); return;
//to avoid IllegalstateException}
No comments:
Post a Comment