Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

local variables getting carried across the request  RSS feed

 
Parag Mokal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,
I'm working on JSP using Tomcat 4. I'm facing problem with the scope of the variables. I've created ResultSet object and provided a facility to delete the displayed Results. The user checks the records to be deleted and the request is forwared to the next page, where the records get deleted. After deleting the records, I forward the request to the same page on which the results were displayed.
The problem is that the ResultSet instance contains the same old values, and it gives NullPointer Exception, as the Record got deleted! I've declared the ResultSet in the scriptlet part <% %>. This means that the values are local to the service method and should not be carried beyond the requests. But the values still presist!
This happens with all the pages. If I'm adding some records on one page and forwarding it to the another page, the URL of the previous page is displayed! Now, if the page is refreshed, the same record with all the same variable values gets added. Please help.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you post portion of your code. decleartion, assignment etc
---------------------
Sainudheen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!