ServletからJSPにフォワード
HttpServletRequest#getRequestDispatcher
の引数はWebContentからのパスを指定することRequestDispatcher#forward
でフォワードの処理を行う
以下、サンプルコード
private void forward(HttpServletRequest request, HttpServletResponse response, String jspName) throws ServletException, IOException { RequestDispatcher dispatcher = request.getRequestDispatcher(jspName); dispatcher.forward(request, response); } ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ... forward(request, response, "/WEB-INF/jsp/main.jsp"); ... }