At the start of my HttpServlet class code:

request.getServletPath() = "/myServlet"

But then my HttpServlet code runs a MVC pattern and decides to forward off to a JSP page "/someDir/myPage.jsp" so inside any tag's inside that JSP page now get:

request.getServletPath() = "/someDir/myPage.jsp"

Which is just plain wrong.  Can anyone confirm if this correct behaviour ?


It seems pretty ludicrious that the request object is meant to be associated with the original request, so I would expect it to remain constant (unless my app overides it), like how we got here is pretty important stuff throughout the whole lifetime of a request.

The forwarding methodology JSP uses seems to be more related to the response part, as-in the path "/someDir/myPage.jsp" is a forwarding action that is being carried out in the response part.


To work around this sillyness:

I have added code into my HttpServlet like 'request.setAttribute("getHttpRequestPath", request.getServletPath())' so that the original HttpRequest information can be preserved throughout the whole request lifecycle.

--
Darryl L. Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to