Bug 26867

Summary: Inconsistent behavior of <io:request>
Product: Taglibs Reporter: Kris Nuttycombe <kris.nuttycombe>
Component: IO TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED LATER    
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://jakarta.apache.org/taglibs/doc/io-doc/index.html#request

Description Kris Nuttycombe 2004-02-11 19:21:35 UTC
One of the major usages of <io:request> is to get around the limitations imposed
by the <jsp:include> tag that limits the developer to including only contents of
the same web application.

According to the documentation of <io:request>,

" The URL to request. If the URL starts with '/' then it is treated as a local
http request "

However, the behavior of URLHelper.createURL(String uri, PageContext
pageContext) is inconsistent with this because it automatically includes the
context path in the resulting URL if the request in the associated PageContext
is an instance of HttpServletRequest (the ordinary case with a JSP.) This means
that <io:request> cannot be used to relatively link to a document in another web
application running on the same server.

Since <jsp:include> already provides the capability to include a document from
the same web application, and in a less roundabout fashion, I strongly recommend
and request that the logic be altered to ignore the context and treat paths
starting with "/" as beginning at the server root, as the documentation
specifies. If the user then desires to use <io:request> to obtain a resource
from the same web application, it is trivial for them to either manually
concatenate the context name to the requested URL, or to simply use a
<jsp:include> tag.
Comment 1 Henri Yandell 2009-11-29 19:38:52 UTC
Resolving. Taglib has been retired.