Hey Dan, Have you tried writing a cookie out in the request header for the servlet you are requesting from the (first) servlet?
Cheers Adrian > -----Original Message----- > From: Dan Hobbs [SMTP:[EMAIL PROTECTED]] > Sent: 01 May 2002 06:24 > To: [EMAIL PROTECTED] > Subject: Maintaining session state when opening a URL from within a > servle t > > Ladies and gents, > > I am trying to write a servlet which will email the response of another > servlet. I've got the opening of the page, reading the response, then > emailing the contents done OK. > > However, the page being read (by way of URLConnection uc = > url.openConnection()) relies heavily on session state. Session tracking is > done using cookies, which are (apparently) not shared between the servlet > running in the browser, and the servlet being requested from within that > servlet. > > I have tried tacking ";jsessionid=" + <HttpSession>.getId() but this > doesn't > work, I suspect since the session interceptor ignores that since it is > only > expecting a cookie. > > Does anyone have any idea on whether it is even possible to use the same > session when requesting servlets in this way, and if so, how? :-) > > I am using Tomcat stand-alone on a Win2k server. IE6 is the browser I am > using to connect. > > Any advice appreciated. > > Thanks, > > Dan > > __________________________________________________________________________ > _ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html -- ********************************************************************** The Truworths e-mail facility may not be used for the distribution of chain letters or offensive email. Truworths hereby distances itself from and accepts no liability for the unauthorised use of its e-mail facility or the sending of e-mail communications for other than strictly business purposes. Truworths furthermore disclaims liability for any unauthorised instruction for which permission was not granted. ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
