1

I'm editing code that is not my own, and need to follow the path of a 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);

How can I find out where the path will take me?

Zibbobz
  • 725
  • 1
  • 15
  • 41

1 Answers1

2

Comment the line dispatcher.forward(request, response) and add this line and then try running the servlet.

out.print(this.getServlet().getServletContext().getRealPath([url]));

This shall return the path to which the dispatcher will get forwarded to.

Sid
  • 381
  • 2
  • 12