访问webinf下面的文件出现404

idea教了访问webinf下面的文件,这个文件是受到保护的,要重定向才能进入,我照着敲了结果访问出现404

img

img

img


package servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(value={"/loginForm.do"})
public class UserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String path = request.getRequestURI();
        path = path.substring(path.lastIndexOf("/")+1, path.indexOf(".do"));
        if(path.equals("loginForm")){
            //如果做了记住密码功能,判断cookie
            request.getRequestDispatcher("jsp/login.jsp").forward(request, response);
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}