tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Eisner <>
Subject Re: encodeURL and Tomcat
Date Tue, 11 Jul 2000 14:30:35 GMT
On Tue, 11 Jul 2000, Carsten Fehlen wrote:

> Hi,
> I know that this question has been asked before, but i can't find an answer!
> How can i get Tomcat to encodeURL?
> I must not use Cookies, so i need the encoding to keep the session!
> I have tried to use "mod_rewrite" in apache but it had no effect (i found a
> note somewhere that says that this would solve the problem).
> Please Help!

I've been having the same problem.  I'm using an applet in my application,
and I've found that the applet holds onto old cookies between invokations,
screwing up session management.  For that reason, I'm trying to pass an
encoded URL as an applet parameter, for use in communicating with the

Here's the behavior I've encountered, with Tomcat 3.2b1:  If I talk
to Tomcat directly, on port 8080, the URL is encoded.  However, if
the interaction goes through apache, the URL is not encoded.  I've
applied the mod_rewrite rule mentioned earlier (RewriteRule
^(/.*;jsessionid=.*)$   $1 [T=jserv-servlet]), but that has no effect.

In any case, I don't think this will solve the problem, because the
problem occurs during the generation of the URL by the servlet, not
when the encoded URL is being used.  

It's true that encodeURL just seems to append ";jsessionid=<sessionid>" 
to the URL, which is trivial to do oneself.  But I can imagine that at
some point in the future this might change, so you might want to write
a myEncodeURL() method which simulates encodeURL according to the current
scheme.  Later on, when encodeURL works, you can just have it call
encodeURL() internally.


> Thanks,
> Carsten

David Eisner            | E-mail: |
CALCE EPSC              | Phone:  301-405-5341       |
University of Maryland  | Fax:    301-314-9269       |

View raw message