日期:2014-05-17  浏览次数:20702 次

Servlet.service() for servlet [jsp] in context with path
后台:
2012-12-9 11:51:47 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/shopping] threw exception [Unable to compile class for JSP: 

An error occurred at line: 12 in the jsp file: /WebRoot/register.jsp
User cannot be resolved to a type
9:       String password = request.getParameter("password");
10:       String phone = request.getParameter("phone");
11:       String addr = request.getParameter("addr");
12:       User u = new User();
13:       u.setUsername(username);
14:       u.setPassword(password);
15:       u.setPhone(phone);

浏览器


代码应该没错就应该配置的问题,求教!!!
------解决方案--------------------
目测没导入User类 <%@ page import="" %>
------解决方案--------------------
可以看出是 12 行出错,应该就是 LS 说的,没有导入这个类。
我的异常网推荐解决方案:Servlet.service() for servlet default threw exception,http://www.aiyiweb.com/eclipse/181756.html