I
beleive, encodeURL() or encodeRedirectURL() should be used for
enabling URL Rewriting.
-Priscilla
-----Original Message-----
From: Aasim [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 29, 2002 12:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Session Management problemBecky,
Thanks for your reply. My browser didn't accept cookies. I enabled them.
Please correct me if I am wrong! I was under the impression that Session Management using Servlets API does not require the use of cookies. I thought Session Tracking using URL Rewriting, Using Cookies and Using Hidden Form Fields were old methods of session tracking and servlet API was designed so that one can do session management without having to use any of these. Is that true?
If yes, why would I require to enable cookies in order to run my code?
Thanks for the help!
--Andy.
Becky Phaneuf <[EMAIL PROTECTED]> wrote:
Andy,
Does your browser accept cookies? If not, turn on the acceptance of cookies b/c the session object makes use of them to "remember" itself.
You have to first retrieve the session, then retrieve the object from it. Did you do that?
I would assume this is your code:
setting: HttpSession sessionName = requst.getSession();
sessionName.setAttribute("objectName", someObject);
getting: HttpSession sessionName = request.getSession();
someObject objectName = (someObject) sessionName.getAttribute("objectName");
If not, fix your code.
It's possible to maintain a session w/out cookies, but you'll have to look that up yourself. :)
-B
>>> [EMAIL PROTECTED] 11/29/02 07:32AM >>>
Frans,
Thanks for your reply.
It is in the same servlet context. Are you saying that it is in the same directory? All my fil es are in the same directory. However, I do have my classes and the web.xml file stored in the WEB-INF directory within my main application directory.
Any suggestions or ideas that I could possibly try?
Thanks!
--Andy.
Frans Verhoef <[EMAIL PROTECTED]>wrote:Andy,
Is the page to which you are redirecting a servlet inside the same ServletContext. A
session can only be used from within the same ServletContext, i.e. the web application
directory.
Frans
On 27 Nov 2002 at 22:19, Aasim wrote:
>
> Dear Servlet-interest users:
> I am new to servlets and I need your help.I am having a problem with session management. I add
> an object to a new HTTP session ina servlet class. Then I redirect my servlet to another page. I
> need to access the originalobject that I previously addedon this page, which is a new class.
> When I try to retrieve the original object from another class using getAttri bute(), it gives me anull
> value. Can this be done? Am I doing something wrong over here or am I missing something?
> Thanks for the help in advance.
> Sincerely,
> --Andy.
>
>
>
>
>
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now
======================================================
Tel: +65 68741415(office) / +65 64670239(home) / +65 98484325(hp)
Email: [EMAIL PROTECTED]
Website: http://www.travel-companion.net
======================================================
___________________________________________________________________________
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: htt p://www.lsoft.com/manuals/user/user.html
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
___________________________________________________________________________
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
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now