簡體   English   中英

跟蹤dispatcher.forward的路徑

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM