tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Session Tracking by URL rewriting
Date Mon, 10 Apr 2000 16:22:20 GMT
Heiko Seeberger wrote:

> Hi,
> I wonder if it is possible do maintain sessions over serveral pages without
> enabling cookies.
> Does Tomcat 3.1 support sessions by URL rewriting? If so, how?

Yes, in the most recent releases of 3.1beta1, and it will be in the final

You do this exactly as the servlet spec tells you to -- by calling
response.encodeURL() or response.encodeRedirectURL() around all the hyperlinks
you generate in your servlet or JSP page.  For example, in a servlet:

    PrintWriter writer = response.getWriter();
    writer.println("<a href=\"" + response.encodeURL("my-url") + "\">My

or in a JSP page

    <a href="<%= response.encodeURL("my-url") %>">My Link</a>

> Thanks.
> Heiko

Craig McClanahan

View raw message