![Eclipse Screen Shot文件结构和错误位于图片中,如果有任何不正确的文件结构请告诉我] [1]错误显示如下图所示,Hello Everyone我是一个servlet beginer ,我有以下servlet代码的问题,任何人都可以帮助修复它。它显示 javax.servlet.http无法解决如何解决这个问题?
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.second.po.User;
import com.second.serivce.UserService;
public class regServlet extends HttpServlet {
//UserDao userDao=new UserDao();//模式一直接通过UserDao访问数据库
private UserService userService=new UserService();//通过类之间的组合关系将其组合
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String uname =request.getParameter("uname").trim();
String pwd =request.getParameter("pwd").trim();
String email =request.getParameter("email").trim();
String phone =request.getParameter("phone").trim();
String address =request.getParameter("address").trim();
int age =Integer.parseInt(request.getParameter("age"));
int gender =Integer.parseInt(request.getParameter("gender"));
int degree =Integer.parseInt(request.getParameter("degree"));
java.sql.Date joinTime=new java.sql.Date(new java.util.Date().getTime());
User user=new User("老高","1234","1808029435@qq.com",18,"13378052446","北京",0,1,joinTime);
userService.register(user);
request.getRequestDispatcher("reg_ok.jsp").forward(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
}