You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Craig Longman <cr...@begeek.com> on 2002/09/17 17:29:30 UTC

this is a bug, right?

when i've done an import (either using the c:insert or tiles:insert) i
find that many of the request.getXXX methods relating to the URL produce
bogus results.  here is what i get (from an included file):

getRequestURI():
<HEAD>
 <TITLE>re
getPathInfo(): null
getPathTranslated(): null
getRequestURL(): http://server.tomcat.begeek.com
<HEAD>
 <TITLE>re
getServletPath(): /debug2.jsp

i cannot find any docs that suggest that once redirected via a
RequestDispatcher that these request methods are no longer reliable.

i have asked this question before but received no answer.  since then, i
have narrowed it down to occurring only in an inserted file.  please
confirm for me this is a problem and i can submit it as a bug.

btw, this is tomcat 4.1.10 that i'm using.

-- 

    CraigL->Thx();
    Be Developer ID: 5852


Re: this is a bug, right?

Posted by Craig Longman <cr...@begeek.com>.
On Wed, 2002-09-18 at 02:43, Bill Barker wrote:
> Not a bug.  c:insert calls RequestDispacher.include, where section 8.3.1 of
> the (2.3) servlet spec requires that getPathInfo, getPathTranslated,
> getServletPath all reflect the values of the "included" servlet.

yeah, although that part tripped me up at first, i have figured it out. 
however, if you look closely at what gets returned for a URI:

getRequestURI():
<HEAD>
 <TITLE>re

that isn't a valid URI no matter who the calling page is.  i'm working
on narrowing this down, it only seems to happen when i've used a tag
that performed a pageContext.include() directly.  if that is done, then
the pageContext.include() produces bogus URIs, as well as any subsequent
c:import tags.  strangely enough, if the c:import is first, then both it
and the custom tag i have work fine and the URIs look good in the
included servlet.

once i can narrow down a simple enough test case, i'll submit it as a
bug.

thanks though.

-- 

    CraigL->Thx();
    Be Developer ID: 5852


Re: this is a bug, right?

Posted by Bill Barker <re...@verizon.net>.
Not a bug.  c:insert calls RequestDispacher.include, where section 8.3.1 of
the (2.3) servlet spec requires that getPathInfo, getPathTranslated,
getServletPath all reflect the values of the "included" servlet.  As per the
section above, you can obtain some of the original values via calling
request.getAttribute with the values respectively:
getPathInfo -> javax.servlet.include.path_info
getServletPath -> javax.servlet.include.servlet_path

getPathTranslated can be mapped to:
application.getRealPath(request.getAttribute("javax.servlet.include.path_inf
o"));


"Craig Longman" <cr...@begeek.com> wrote in message
news:1032276570.22212.54.camel@jigra.begeek.com...





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>