Hi I am geting problem with the session in servlet.I am using the jswdk 1.0.1 as webserver. I am chaining 4 servlets one by one and passing the session variable from one servlet to other servlet. But when I tried to access the session variable from the next servlets, getting the session variable as null.
I am using the session objects as follows in all the 4 servlets. No where I used session invalidate or timeout methods. HttpSession httpSession = req.getSession(true); session.getValue(arg); session.putValue(arg); thanks srao
Joined: Feb 25, 2001
Hi, Are you forwarding the request from one servlet to another within the server OR you r first going to the browser then next servlet then browser and so on....If second is your case then U try encodeURL before submitting to the jsp. If first is you case then send some lines of your code. my mail id is ..firstname.lastname@example.org Deepak ------------------ Be Truthful to yourself!
Be Truthful to yourself!
Joined: Oct 25, 2000
Hi, U can use encodeURL of HttpServletRequest class .What this meyhod does is it attaches the current session id to the url and then sends it to the server. So the session will not get invalidate when the data is send from one servlet to the other servlet.
------------------ Try and Try Till u succeed Sandeep Jain
Try and Try Till u succeed<br /> <br />Sandeep Jain
Joined: Nov 13, 2001
Dear Sandeep, I tried using this URLencode, but my problem was not solved, please give alternate solution thanks Hari