From Craig.McClanahan@eng.sun.com Fri Sep 22 17:40:40 2000 Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 6599 invoked from network); 22 Sep 2000 17:40:40 -0000 Received: from mercury.sun.com (192.9.25.1) by locus.apache.org with SMTP; 22 Sep 2000 17:40:40 -0000 Received: from taller.eng.sun.com ([129.144.124.34]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id KAA16093 for ; Fri, 22 Sep 2000 10:40:39 -0700 (PDT) Received: from eng.sun.com (florence [129.144.251.146]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with ESMTP id KAA27572 for ; Fri, 22 Sep 2000 10:40:38 -0700 (PDT) Message-ID: <39CB99D7.3F82F26D@eng.sun.com> Date: Fri, 22 Sep 2000 10:41:43 -0700 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: Help - Ongoing problem with encodeURL References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N (Please use ASCII mode when sending mail to mailing lists -- not everyone can correctly interpret HTML mail). Peter Slade wrote: > > I pulled down tomcat milestone build (3.2 beta 4). My test application > now shows a session id on the url that it did not show with the 3.1 > version. However I do not understand the url that it generates, and my > application fails for different reason. > My output shows that > response.encodeURL("http://servername/page.jsp?test=true") will > return > http://servername/page.jsp;jsessionid=hgdyjjbif1?test=true > shouldn't it have returned something like > http://servername/page.jsp?jsessionid=hgdyjjbif1&test=true > and response.encodeURL("http://servername/page.jsp") will return > http://servername/page.jsp;jsessionid=hgdyjjbif1 > shouldn't it have returned something like > http://servername/page.jsp?jsessionid=hgdyjjbif1 > If I put the url that it generates into a browser it will fail with > 404 Page Not Found. > Why is the ; character being used instead of a ? character? > Am I missing something? Is this a bug? > Pete. > This is not a bug. The 2.2 version of the servlet specification mandates the name of the session cookie (JSESSIONID) and the fact that it must be passed as a *path* parameter (with a semicolon) rather than a query parameter. For standalone Tomcat, you do not have to do anything other than call response.encodeURL() for your links -- Tomcat will parse the session id out of the URL when the user clicks the hyperlink. If you are running behind Apache, you have to enable MOD_REWRITE and add a rewrite rule so that Apache still recognizes the fact that this is a JSP page and forwards the request to Tomcat for processing. The details are in the Tomcat FAQ-O-MATIC () -- search for "URL rewriting". Craig McClanahan ==================== See you at ApacheCon Europe ! Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ Applications to Tomcat