当前位置: 代码迷 >> Java Web开发 >> Servlet.service() for servlet [jsp] in context with path解决办法
  详细解决方案

Servlet.service() for servlet [jsp] in context with path解决办法

热度:65   发布时间:2016-04-16 22:25:27.0
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 说的,没有导入这个类。
  相关解决方案