You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Alex Kachanov <al...@intadev.com> on 2002/07/11 05:33:25 UTC

getRequestURI()

Hello!

This is a page:

<%@ page contentType="text/html;charset=Shift_JIS"%>
<%@page session="true"%>

<p><%= request.getRequestURI() %></p>

<p><%= session.getId() %></p>

So, guys, what do you think "request.getRequestURI()" method should return
when cookies are switched OFF in browser and the request is

http://localhost/index.jsp;jsessionid=384975938475?blah=7&bloh=9


JRun 3.1 and Jrun 4.0 are sure it should return
/index.jsp;jsessionid=384975938475


While all other Application servers (including Tomcat) return just:
/index.jsp



Who is right?


with best wishes
Alexander Kachanov

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


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


Re: getRequestURI()

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: "Bill Barker" <wb...@wilshire.com>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Wednesday, July 10, 2002 10:34 PM
Subject: Re: getRequestURI()


> Hum, it does look like the spec is a bit schizophrenic here.  The
> ;jessionid= isn't part of the requestURI in section 4.4:
> <spec-quote section="4.4" version="2.3">
> It is important to note that, except for URL encoding differences between
> the
> request URI and the path parts, the following equation is always true:
>
> requestURI = contextPath + servletPath + pathInfo
> </spec-quote>
>
> However, in section 15.1.3 it very clearly is:
> <spec-quote section="15.1.3" version="2.3>
> public java.lang.String getRequestURI()
>
> Returns the part of this request’s URL from the protocol name up to the
> query
> string in the first line of the HTTP request.
> </spec-quote>
>

Never mind, my mistake.  The ;jsessionid is part of the URI, not the URL
(RFC 2396).  Tomcat is right, and JRun is wrong.

> Off-hand, I'd say that it's a good question for
> servletapi-feedback@eng.sun.com so that it can be clarified in the
up-coming
> 2.4 spec.
>
> ----- Original Message -----
> From: "Alex Kachanov" <al...@intadev.com>
> To: <to...@jakarta.apache.org>
> Sent: Wednesday, July 10, 2002 8:33 PM
> Subject: getRequestURI()
>
>
> Hello!
>
> This is a page:
>
> <%@ page contentType="text/html;charset=Shift_JIS"%>
> <%@page session="true"%>
>
> <p><%= request.getRequestURI() %></p>
>
> <p><%= session.getId() %></p>
>
> So, guys, what do you think "request.getRequestURI()" method should return
> when cookies are switched OFF in browser and the request is
>
> http://localhost/index.jsp;jsessionid=384975938475?blah=7&bloh=9
>
>
> JRun 3.1 and Jrun 4.0 are sure it should return
> /index.jsp;jsessionid=384975938475
>
>
> While all other Application servers (including Tomcat) return just:
> /index.jsp
>
>
>
> Who is right?
>
>
> with best wishes
> Alexander Kachanov
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


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


Re: getRequestURI()

Posted by Eddie Bush <ek...@swbell.net>.
Ah - now I feel stupid. I was thinking he was saying encodeURL didn't
put it there. According to what your interpretation is he things
getRequestURI doesn't get it back. :-/ I'll buy that - especially since
you're quoting it from the docs ;-) *feels stupid*

Is it a usage question rather than an implementation question? You can
get the querystring too. It does make for another call - but you can
bypass the expense of the concatenation by just printing them out
adjacent. Right?

Thinking ...

Eddie

Bill Barker wrote:

>Hum, it does look like the spec is a bit schizophrenic here.  The
>;jessionid= isn't part of the requestURI in section 4.4:
><spec-quote section="4.4" version="2.3">
>It is important to note that, except for URL encoding differences between
>the
>request URI and the path parts, the following equation is always true:
>
>requestURI = contextPath + servletPath + pathInfo
></spec-quote>
>
>However, in section 15.1.3 it very clearly is:
><spec-quote section="15.1.3" version="2.3>
>public java.lang.String getRequestURI()
>
>Returns the part of this request’s URL from the protocol name up to the
>query
>string in the first line of the HTTP request.
></spec-quote>
>
>Off-hand, I'd say that it's a good question for
>servletapi-feedback@eng.sun.com so that it can be clarified in the up-coming
>2.4 spec.
>


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


Re: getRequestURI()

Posted by Bill Barker <wb...@wilshire.com>.
Hum, it does look like the spec is a bit schizophrenic here.  The
;jessionid= isn't part of the requestURI in section 4.4:
<spec-quote section="4.4" version="2.3">
It is important to note that, except for URL encoding differences between
the
request URI and the path parts, the following equation is always true:

requestURI = contextPath + servletPath + pathInfo
</spec-quote>

However, in section 15.1.3 it very clearly is:
<spec-quote section="15.1.3" version="2.3>
public java.lang.String getRequestURI()

Returns the part of this request’s URL from the protocol name up to the
query
string in the first line of the HTTP request.
</spec-quote>

Off-hand, I'd say that it's a good question for
servletapi-feedback@eng.sun.com so that it can be clarified in the up-coming
2.4 spec.

----- Original Message -----
From: "Alex Kachanov" <al...@intadev.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, July 10, 2002 8:33 PM
Subject: getRequestURI()


Hello!

This is a page:

<%@ page contentType="text/html;charset=Shift_JIS"%>
<%@page session="true"%>

<p><%= request.getRequestURI() %></p>

<p><%= session.getId() %></p>

So, guys, what do you think "request.getRequestURI()" method should return
when cookies are switched OFF in browser and the request is

http://localhost/index.jsp;jsessionid=384975938475?blah=7&bloh=9


JRun 3.1 and Jrun 4.0 are sure it should return
/index.jsp;jsessionid=384975938475


While all other Application servers (including Tomcat) return just:
/index.jsp



Who is right?


with best wishes
Alexander Kachanov

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


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



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