Friday, 13 September 2013

Now I have been stuck by an error which shows the following error in the internet explorer

Now I have been stuck by an error which shows the following error in the
internet explorer

type Exception reportmessage description The server encountered an
internal error () that prevented it from fulfilling this request.exception
java.lang.NumberFormatException: null java.lang.Integer.parseInt(Unknown
Source) java.lang.Integer.parseInt(Unknown
Source)AgeCheck.doGet(AgeCheck.java:16)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722) note The full
stack trace of the root cause is available in the Apache Tomcat/7.0.14
logs. enter code here public class AgeCheck extends HttpServlet{public
void doGet(HttpServletRequest req,HttpServletResponse res)throws
ServletException,IOException{res.setContentType("text/html");PrintWriter
out=res.getWriter();int
age;age=Integer.parseInt(req.getParameter("age"));out.print("
Welcome To Age Check Page
");RequestDispatcher rd; if(age>=20){rd
=eq.getRequestDispatcher("Major");rd.include(req,res); }else{rd =
req.getRequestDispatcher("Minor");rd.forward(req,res);}out.print("
Re-Welcome ToSame Class
");}}

No comments:

Post a Comment