• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSession failure--Help

 
N SRao
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
deepak bansal
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ..deepak_gupta@infy.com
Deepak
------------------
Be Truthful to yourself!
 
Sandeep Jain
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
N SRao
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sandeep, I tried using this URLencode, but my problem was not solved, please give alternate solution
thanks
Hari
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic