Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with instance variables

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my program i am using instance variable for incrementing a value..
so i declared using jsp declaration tag.
here i find some problem if i move back to the page the instance variable remains same.. it doesn't die..
problem is i am suing that instance variable for incrementation..in the loop
so if go back to the previous page and then come back to the current page the i value remains same and it gives arrayindexoutofbounds exception...

please help me out
thanks in advance
cinux
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saikrishna cinux:

please help me out


please help me out by posting your code here
 
Jass Singh
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though without code it is not clear, but if is used in loop increment then you should use a local variable rather than instance variable in JSP.

So declare it in scriplets i.e. <% %> and not in jsp declaration tag.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!