Type Exception report
The message Unable to compile class for JSP:
Description The server encountered an internal error that prevented it from fulfilling this request.
The exception
Org. Apache. Jasper. JasperException: Unable to compile class for JSP:
An error occurred at line: 19 in the JSP file:/Doregister JSP
The method setAge (Integer) in The type User is not applicable for The arguments (String)
16: User u=new User ();
17: u.s etName (name);
18: u.s etPass (pass);
19: u.s etAge (age);
20: UserDao udao=new UserDao ();
21://call the method that udao implementation into function
22: int x=udao. Insert (u);
Stacktrace:
Org.apache.jasper.com piler. DefaultErrorHandler. JavacError (DefaultErrorHandler. Java: 92)
Org.apache.jasper.com piler. ErrorDispatcher. JavacError (ErrorDispatcher. Java: 330)
Org.apache.jasper.com piler. JDTCompiler. GenerateClass (JDTCompiler. Java: 460)
Org.apache.jasper.compiler.Compiler.com running (356) Compiler. Java:
Org.apache.jasper.compiler.Compiler.com running (334) Compiler. Java:
Org.apache.jasper.compiler.Compiler.com running (321) Compiler. Java:
Org.apache.jasper.JspCompilationContext.com from running (JspCompilationContext. Java: 592)
Org. Apache. Jasper. Servlet. JspServletWrapper. Service (328) JspServletWrapper. Java:
Org. Apache. Jasper. Servlet. JspServlet. ServiceJspFile (JspServlet. Java: 321)
Org. Apache. Jasper. Servlet. JspServlet. Service (267) JspServlet. Java:
Javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 723)
Note The full stack trace of The root cause is available in The Apache Tomcat/6.0.53 logs.
Doregister. JSP:
<% @ page import="com. Tao. The entity. The User" % & gt;
<% @ page language="Java" contentType="text/HTML. Charset=utf-8 "
PageEncoding="utf-8" % & gt;
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
<body>
<%//to get name password, and age
String name=request. The getParameter (" username ");
String pass=request. The getParameter (" password ");
String age=request. The getParameter (" age ");
The User u=new User ();
U.s etName (name);
U.s etPass (pass);
U.s etAge (age);
UserDao udao=new UserDao ();
//call the method that udao implementation into function
Int x=udao. Insert (u);
If (x>=1) {
//forwarding, if & gt; 1, jump to success2. The JSP page
Request. GetRequestDispatcher ("/Success. JSP "). The forward (request, response);
}
% & gt;