import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ServletExcep extends HttpServlet
{
public void service(HttpServletRequest req,
HttpServletResponse res)throws ServletException,
IOException
{
res.setContentType("text/html");
PrintWriter out= res.getWriter();
out.println("TEST MESSAGE----");
try
{
int
statusCode=Integer.parseInt(req.getParameter("statusCode"));
out.println("statuscode--"+statusCode);
}
catch(Exception e)
{
res.sendError(500, " SORRY WRONG VALUE PASSED");
}
}
}
Here , if i run the file i am getting error
" HELP/NAVIGATION ERROR - File Not Found
Unable to find
http://localhost:8090/examples/servlet/ServletExcep "
if i make comment from try block to catch block, the it shows message "
TEST MESSAGE----- ".
i dont know whats wrong??/
please clarify..
thanks in advance
Gopal