when we can get the attribute's values directly
<jsp:include page="page2.jsp" />
And in page2.jsp
When I run the page1.jsp like this:
Section SRV.8.3.1 of the spec speaks about the javax.servlet.include.* attributes in these terms:
Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the include method of RequestDispatcher has access to the path by which it was invoked.
[...]their values must be equal to the request URI, context path, servlet path, path info, and query string of the included servlet, respectively. If the request is subsequently included, these attributes are replaced for that include.
Whereas in section SRV.8.4.2, it states the following for the javax.servlet.forward.* attributes:
Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the forward method of RequestDispatcher has access to the path of the original request.
The values of these attributes must be equal to the return values of the HttpServletRequest methods getRequestURI, getContextPath, getServletPath,
getPathInfo, getQueryString respectively, invoked on the request object passed to the ﬁrst servlet object in the call chain that received the request from the client.
I didn't know either that it worked that way. I supposed that both forward and include's attributes were giving the original request parameters. But it seems that both behave differently.
[ April 30, 2007: Message edited by: Sergio Tridente ]
I think i got it, these attributes are usefull in the cases where we do include/forward from an Servlet. Correct me if i'm wrong.