You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajan Gupta <rg...@yahoo.com> on 2001/03/13 16:22:57 UTC

html:link

Hi! All,
The mail reader documentation suggests that html:link encodes the session
id with the link if the browser has turned off cookies. What does it mean
by saying
"Automatically URL-encodes hyperlinks as needed"

Does it depend upon if cookies are enabled or not? But I could not see
that in the code, I think it always encodes the url regardless.

Any insight on this or I am missing something?

Thanks
Rajan


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

Re: html:link

Posted by James Cook <ji...@iname.com>.
The servlet container implements the encodeURL method.

If yo want to see the implementation, check out the encodeURL() method at:

http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat-4.0/catalina/src/share
/org/apache/catalina/connector/HttpResponseBase.java?rev=1.27&content-type=text/
vnd.viewcvs-markup

jim

----- Original Message -----
From: "Rajan Gupta" <rg...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 13, 2001 10:22 AM
Subject: html:link
> Hi! All,
> The mail reader documentation suggests that html:link encodes the session
> id with the link if the browser has turned off cookies. What does it mean
> by saying
> "Automatically URL-encodes hyperlinks as needed"
>
> Does it depend upon if cookies are enabled or not? But I could not see
> that in the code, I think it always encodes the url regardless.
>
> Any insight on this or I am missing something?
>
> Thanks
> Rajan
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/


Re: html:link

Posted by Rajan Gupta <rg...@yahoo.com>.
Excellent and Thanks
--- "Craig R. McClanahan" <cr...@apache.org> wrote:
> 
> 
> On Tue, 13 Mar 2001, Rajan Gupta wrote:
> 
> > Hi! All,
> > The mail reader documentation suggests that html:link encodes the
> session
> > id with the link if the browser has turned off cookies. What does it
> mean
> > by saying
> > "Automatically URL-encodes hyperlinks as needed"
> > 
> > Does it depend upon if cookies are enabled or not? But I could not see
> > that in the code, I think it always encodes the url regardless.
> > 
> > Any insight on this or I am missing something?
> > 
> 
> It is a clumsy way of saying that Struts always calls
> response.encodeURL() or response.encodeRedirectURL() for you.
> 
> Whether the session ID actually shows up in the generated hyperlink or
> not
> depends on whether the servlet container thinks your client has cookies
> enabled or not.  On the first response that is part of the session, the
> container has no way to know - so it sends the session ID both ways (as
> a
> cookie and in the URL).  If the second request contains the session
> cookie, the container says "aha, this client supports cookies" so it
> stops
> modifying the generated URLs on hyperlinks.  The call to
> response.encodeURL() is still happening; it is just returning the URL
> without modifying it.
> 
> See the Servlet Specification, version 2.2, for more information about
> how
> session tracking works.
> 
> 	http://java.sun.com/products/servlet/download.html
> 
> 
> > Thanks
> > Rajan
> > 
> 
> Craig McClanahan
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

Re: html:link

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 13 Mar 2001, Rajan Gupta wrote:

> Hi! All,
> The mail reader documentation suggests that html:link encodes the session
> id with the link if the browser has turned off cookies. What does it mean
> by saying
> "Automatically URL-encodes hyperlinks as needed"
> 
> Does it depend upon if cookies are enabled or not? But I could not see
> that in the code, I think it always encodes the url regardless.
> 
> Any insight on this or I am missing something?
> 

It is a clumsy way of saying that Struts always calls
response.encodeURL() or response.encodeRedirectURL() for you.

Whether the session ID actually shows up in the generated hyperlink or not
depends on whether the servlet container thinks your client has cookies
enabled or not.  On the first response that is part of the session, the
container has no way to know - so it sends the session ID both ways (as a
cookie and in the URL).  If the second request contains the session
cookie, the container says "aha, this client supports cookies" so it stops
modifying the generated URLs on hyperlinks.  The call to
response.encodeURL() is still happening; it is just returning the URL
without modifying it.

See the Servlet Specification, version 2.2, for more information about how
session tracking works.

	http://java.sun.com/products/servlet/download.html


> Thanks
> Rajan
> 

Craig McClanahan