Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 4653 invoked from network); 4 Jan 2007 13:22:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2007 13:22:30 -0000 Received: (qmail 98826 invoked by uid 500); 4 Jan 2007 13:22:23 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 98785 invoked by uid 500); 4 Jan 2007 13:22:23 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 98774 invoked by uid 99); 4 Jan 2007 13:22:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jan 2007 05:22:23 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of len.popp@gmail.com designates 66.249.92.170 as permitted sender) Received: from [66.249.92.170] (HELO ug-out-1314.google.com) (66.249.92.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jan 2007 05:22:14 -0800 Received: by ug-out-1314.google.com with SMTP id h2so5055540ugf for ; Thu, 04 Jan 2007 05:21:53 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=iA5YXgdugnMk22n7mx8p5hbtQgMddXIDjFflyoO8TQpfRit4elwXSsTHj4put0ZWSogt1d1iIbU9qxqIj0WOhtykiFtIxH5OTGjwEBBZ+nMCneliypIVINMOpfpGE/c8M+H7qSdrozgcm9MwhXuCn2QOfLA6To/eZanDg92nx8w= Received: by 10.82.118.2 with SMTP id q2mr1995328buc.1167916912759; Thu, 04 Jan 2007 05:21:52 -0800 (PST) Received: by 10.82.184.9 with HTTP; Thu, 4 Jan 2007 05:21:52 -0800 (PST) Message-ID: <497fac690701040521qb18fb2arb20e5c3a0eb2e78c@mail.gmail.com> Date: Thu, 4 Jan 2007 08:21:52 -0500 From: "Len Popp" To: "Tomcat Users List" Subject: Re: URL rewriting For Session Tracking In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5134_10470330.1167916912720" References: <00d501c72fc8$1cb11340$3c34de0a@shahpoor> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_5134_10470330.1167916912720 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Or if you use the JSP standard tag lib (JSTL) you can do: second page -- Len On 1/4/07, Bill Barker wrote: > > Usually you would use a tag lib for this sort of thing. With struts, it > would look something like: > second page > > wrote in message > news:00d501c72fc8$1cb11340$3c34de0a@shahpoor... > > Your reply answered another question that I had. But I think I still > > haven't described my current question clearly. suppose I have 3 JSP > pages > > in my application. > > -- > > first.jsp > > second.jsp > > third.jsp > > -- > > Now, in my first.jsp, I have nothing but 2 links to the other two JSP > > pages. If I want the session to be maintain when use clicks on the links > > to go to the other pages, then can first.jsp be the following: > > -- > > second page > > third page > > -- > > Or, the code in first.jsp must be the following: > > -- > > second page > > >second page > > ---- > > > > Note: If I use the first syntax, then unless Tomcat or some patch or > > filter parse the code and add the jsessionid to the link automatically, > > then the user will be losing the session when to goes from first.jsp to > > the other ones. And that's my question; can I use the first syntax. Or > > there is no way but to use the second syntax if I want the session to be > > kept. > > > > > > Thanks, > > Kasra > > ----- Original Message ----- > > From: "Caldarale, Charles R" > > To: "Tomcat Users List" > > Sent: Wednesday, January 03, 2007 9:56 PM > > Subject: RE: URL rewriting For Session Tracking > > > > > >> From: jobs@ultratechpartners.com [mailto:jobs@ultratechpartners.com] > >> Subject: Re: URL rewriting For Session Tracking > >> > >> Basically I have a webapp and I want to have a session > >> for each user that connects to my server (just the usual > >> servlet session that is created with jsessionid). Do I > >> have to wrap every link that I have in my webapp with an > >> Httpservletresponse.encodeURL()? > > > > No. As I recall, Tomcat will not create a session automatically unless > > it's absolutely necessary (e.g., tracking authenticated users) or the > > application requests it. I'm not aware of any config parameter that > > will force creation of sessions for all clients, but all you should have > > to do is put the following somewhere in the request processing path of > > each servlet: > > request.getSession(true); > > > > This doesn't need to go into your servlet or JSP code - you can write a > > simple filter class that does nothing but run the above code to force > > the creation of a session if one doesn't already exist. The filter > > mapping can go into conf/web.xml so it will apply to all apps deployed > > within your Tomcat instance, or in each appropriate webapp's web.xml > > file. > > > > Note that per the servlet spec, Tomcat will use cookies not URL > > rewriting for session tracking; it will fall back to URL rewriting if > > the client refuses cookies. You can also disable use of cookies by > > setting cookies="false" in your elements (or the global > > conf/context.xml file). > > > > - Chuck > > > > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > > MATERIAL and is thus for use only by the intended recipient. If you > > received this in error, please contact the sender and delete the e-mail > > and its attachments from all computers. > > > > --------------------------------------------------------------------- > > To start a new topic, e-mail: users@tomcat.apache.org > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > > --------------------------------------------------------------------- > > To start a new topic, e-mail: users@tomcat.apache.org > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > ------=_Part_5134_10470330.1167916912720--