【发布时间】:2014-04-10 21:46:55
【问题描述】:
考虑层次结构:
我将我的 JSP 从 WEB-INF 移动到 src 文件夹。但是当我尝试 dispatcher.forward() 时,我得到:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
controller.LoginPage.doPost(LoginPage.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.50 logs.
Apache Tomcat/7.0.50
指定的异常发生在以下行中:
String addressPath = "/../view/admin/adminPage.jsp";
RequestDispatcher dispatcher = request.getRequestDispatcher(addressPath);
dispatcher.forward(request, response);
如何修复路径?
谢谢
【问题讨论】:
标签: java http tomcat servlets relative-path