首页上一页 1 下一页尾页 1 条记录 1/1页
Java Web从入门到精通,第九章第三个例子报错。
发表在JavaWeb图书答疑
2013-03-18
是否精华
是
否
版块置顶:
是
否
Java Web从入门到精通,第九章第三个例子报错。监听器是不是因为没有在xml注册还是什么?
代码比较乱。
先是import.sql.*有问题删除后,index.jsp可以了,两个监听的servlet好像有问题!
HTTP Status 500 - Unable to compile class for JSP:
--------------------------------------------------------------------------------
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 12 in the jsp file: /showUser.jsp
UserInfoTrace cannot be resolved to a type
9: </head>
10: <%session.setMaxInactiveInterval(10);
11:
12: UserInfoTrace ut=new UserInfoTrace();
13: String name=request.getParameter("user");
14: ut.setUser(name);
15: session.setAttribute("list",ut);
An error occurred at line: 12 in the jsp file: /showUser.jsp
UserInfoTrace cannot be resolved to a type
9: </head>
10: <%session.setMaxInactiveInterval(10);
11:
12: UserInfoTrace ut=new UserInfoTrace();
13: String name=request.getParameter("user");
14: ut.setUser(name);
15: session.setAttribute("list",ut);
An error occurred at line: 17 in the jsp file: /showUser.jsp
UserInfoList cannot be resolved to a type
14: ut.setUser(name);
15: session.setAttribute("list",ut);
16:
17: UserInfoList list=UserInfoList.getInstance();
18: list.addUserInfo(ut.getUser());
19:
20: %>
An error occurred at line: 17 in the jsp file: /showUser.jsp
UserInfoList cannot be resolved
14: ut.setUser(name);
15: session.setAttribute("list",ut);
16:
17: UserInfoList list=UserInfoList.getInstance();
18: list.addUserInfo(ut.getUser());
19:
20: %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.37 logs.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.37
代码比较乱。
先是import.sql.*有问题删除后,index.jsp可以了,两个监听的servlet好像有问题!
HTTP Status 500 - Unable to compile class for JSP:
--------------------------------------------------------------------------------
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 12 in the jsp file: /showUser.jsp
UserInfoTrace cannot be resolved to a type
9: </head>
10: <%session.setMaxInactiveInterval(10);
11:
12: UserInfoTrace ut=new UserInfoTrace();
13: String name=request.getParameter("user");
14: ut.setUser(name);
15: session.setAttribute("list",ut);
An error occurred at line: 12 in the jsp file: /showUser.jsp
UserInfoTrace cannot be resolved to a type
9: </head>
10: <%session.setMaxInactiveInterval(10);
11:
12: UserInfoTrace ut=new UserInfoTrace();
13: String name=request.getParameter("user");
14: ut.setUser(name);
15: session.setAttribute("list",ut);
An error occurred at line: 17 in the jsp file: /showUser.jsp
UserInfoList cannot be resolved to a type
14: ut.setUser(name);
15: session.setAttribute("list",ut);
16:
17: UserInfoList list=UserInfoList.getInstance();
18: list.addUserInfo(ut.getUser());
19:
20: %>
An error occurred at line: 17 in the jsp file: /showUser.jsp
UserInfoList cannot be resolved
14: ut.setUser(name);
15: session.setAttribute("list",ut);
16:
17: UserInfoList list=UserInfoList.getInstance();
18: list.addUserInfo(ut.getUser());
19:
20: %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.37 logs.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.37