Forums Register Login

forward problem in JSP

+Pie Number of slices to send: Send
Hi Helpers,
I have a problem in accessing the session data in my JSP. The actual session is created by a servlet. Then after validation, forwards this to a jsp page. In this jsp page, i am not able to access the data stored in session object. I believe a new session is getting created.
(Interestingly, when this JSP in turn invokes another servlet, i am able to acces the same session object created in the first servlet).
Can somebody help in this ?
Thanks
sankar
+Pie Number of slices to send: Send
Make sure you are NOT using the session object in declarations like
<%! session.getValue(MY_KEY)%>
That won't work because the implicit objects are LOCAL variables of the service() method of the generated servlet.
You have to use
<% session.getValue(MY_KEY)%>
instead.
+Pie Number of slices to send: Send
Thanks Tony. I will check my JSP and will inform you about the progress.
regards
sankar
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 884 times.
Similar Threads
Session data
Communication session , servlet applet and back from applet servlet and session
sending session object from servlt-multiple jsp's
servlets + jsp
getting session value in JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:15:01.