You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/11/03 22:54:58 UTC
Re: Should IncludeTag be used instead of <%@ include...> or how
navigation menu should be build
Colin Sampaleanu wrote:
>
> _but_ with the present implementation of ActionServlet you can not use
> jsp:include include a url that is a struts Action request/call. This is
> because RequestDispatcher.include() does not change the path element and
> parameters of the request object, and ActionServlet depends on these to
> decide which action to call. ActionServlet will still think the request is
> for the original resource (the one doing the include). What I have used
> successfully is to have a modified subclass of ActionServlet that can
> recognize a special 'path override' parameter that it can use instead to
> decide on the action to take. I would suggest that this functionality is
> worth putting in the base ActionServlet implementation...
Yep, that is *definitely* worth fixing. And it turns out to be easy as well.
RequestDispatcher.include() doesn't change the path elements of the request
object, but it *does* store request attributes for the path elements of an
"include", so the controller servlet can easily tell whether this is the case
or not. I will fix that in the 1.0 code base shortly.
Craig