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 files 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 getAttribute(),
>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: http://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