[英]Tracing the path of a dispatcher.forward
我正在编辑不属于我自己的代码,需要遵循RequestDispatcher的路径。
RequestDispatcher dispatcher = this.getServlet().getServletContext().getRequestDispatcher([url]);
if (dispatcher == null) {
throw new Exception("Unable to find " + [url]);
}
logger.debug("Dispatching request to PDF Writer Servlet " + dispatcher.toString());
dispatcher.forward(request, response);
我怎样才能找到路径将带我去哪里?
注释行dispatcher.forward(请求,响应)并添加此行,然后尝试运行servlet。
的out.print(this.getServlet()的getServletContext()getRealPath([URL]));
这将返回调度程序将转发到的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.