• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with getting result from session

 
carl chan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all:
In my result.jsp page, i get my "RESULT" from my session using getAttribute("somename"). After some process in my app, i update the session in my servlet by using setAttribute("somename", some_object).
and then i called result.jsp again.
What i expected is to see some changes beacuse the session should give me the most updated result.
but what i keep seeing is the old result from the first time i load the result.jsp. In other words, result.jsp is still calling the old_result object to display the data.
My question is that how can i ensure that result.jsp is getting the most updated object from the session. thanks
 
Engin Okucu
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Carl,
I think your are doing something lik this :
session.setAttibute("name",YourObject);
YourObject yo = (YourObject)session.getAttribute("name");
in order to get the most recent value whith getAttribute try this :
request.setAttibute("name",YourObject);
YourObject yo = (YourObject)request.getAttribute("name");
i hope it will help you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!