HTTP状态404-未找到 java eclipse-jee 正在做跟传智书城类似的项目
环境配置:
public class ShowIndexServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//查询最近一条公告,传递到index.jsp页面进行展示
NoticeService nService = new NoticeService();
Notice notice = nService.getRecentNotice();
request.setAttribute("n", notice);
//请求转发
request.getRequestDispatcher("/client/index.jsp").forward(request, response);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
index.jsp有,在web.xml也有配置,但还是报404
(同样的环境配置itcaststore那个项目就能成功运行,但我的就不行)
去搜过处理方法了,但是解决不了,就想来问问大家,怎么处理??
就是想要它能将项目首页(index.jsp-->ShowIndexServlet)显示出来
web.xml中