Bug 26867 - Inconsistent behavior of <io:request>
Summary: Inconsistent behavior of <io:request>
Status: RESOLVED LATER
Alias: None
Product: Taglibs
Classification: Unclassified
Component: IO Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: http://jakarta.apache.org/taglibs/doc...
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 19:21 UTC by Kris Nuttycombe
Modified: 2009-11-29 19:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.