Skip to main content
Submitted by Xenoveritas on
Topics

I'm assuming these are documented somewhere, but they certainly weren't listed in the documentation I have.

Anyhoo:

javax.servlet.forward.request_uri - the original value returned from request.getRequestURI()
javax.servlet.forward.context_path - the original value returned from request.getContextPath()
javax.servlet.forward.servlet_path - the original value returned from request.getServletPath() (who'd have guessed?)

These answer the question I've spent far too long trying to figure out, "how do you figure out the original request URI before the request was forwarded?"

Apparently these were added as of Java Servlets 2.4.