More precisely, for any URL you display back to the browser which refers to a servlet within the zone, you are supposed to pass it through the rewriter by calling "response.encodeURL()" on it. If the servlet engine has successfully pushed and got back a cookie then it will leave the URL alone, if not it will encapsulate a session id into it in some way. Many setups nowadays just assume the browser supports cookies, and the user community is acclimatised to having to have them on to make sites work, but this can be a problem with some wireless devices.

Strictly correct behaviour means that the URL's on the first page of a new session must be rewritten. One method commonly used is to bounce inbound "homepage" requests via a servlet which tosses a response.redirect() to establish the cookie before serving the first page.

A point to watch:

Unlike most Java appservers, which use a custom encoding which the browser sees as part of the servlet name to rewrite URL's ( e.g. ATG Dynamo's http://www.foo.org/zone/servlet;$sessionid$12345678 ), JServ  uses a querystring argument when doing URL rewriting - this works OK, but has the disadvantage that you can't use it with METHOD=GET forms. Also, you can't rewrite the URL and then just tack a querystring on afterwards.
 
 

Gregory Lahens wrote:

----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

By default it uses cookies, if that fails then it uses URL rewriting....

-Greg

At 03:52 PM 1/22/01, you wrote:
>----------------------------------------------------------------
>BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
>WHEN YOU POST, include all relevant version numbers, log files,
>and configuration files.  Don't make us guess your problem!!!
>----------------------------------------------------------------
>
>Hi,
>
>does anyone know how the session tracking is done by the JavaServlet API?
>It seems not to be done by URL Rewriting.
 


--
David Crooke, Austin TX, USA.
Bibo ergo sum.
Open Standards. Open Source. Open Minds.
 

Reply via email to