菜鸟求助关于servlet的问题
JSP里
<li><a href="<%=request.getContextPath()%>/UserAdminServlet" target="mainFrame"><img src="../images/btn_users.gif" /></a></li>
UserAdminServlet的主要代码
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session=request.getSession();
UserDao userDao=new UserDaoImpl();
UserServiceImpl userService=new UserServiceImpl();
userService.setUserDao(userDao);
List<User> userList = userService.getUserList();
session.setAttribute("userList", userList);
response.sendRedirect("jsp/userAdmin.jsp");
}
我点击图片调用Servlet 就是一片空白什么都没有
userAdmin.jsp是一个存在可单独运行非空白页面
[解决办法]
protected void doPost(HttpServletRequest request, HttpServletResponse response)
改成
protected void doGet(HttpServletRequest request, HttpServletResponse response)
你的是get方法,不是post