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

JSP Declaration tag  RSS feed

 
Venkatesh Rajendran
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Is it ok to use JSP declaration tag? I have heard if we use the declaration tag then this variable name will be shared by all threads and the particular variable will be overridden. Is it true? please advise me on this? can we use this tag in our Jsp files.
Thanking you in advance.
Regards,
Venkat
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Declaration:
<%! int i = 0 %>
This declares an instance member of the class so it is not thread safe.
<% int i =0; %>
creates a local variable of the _jspService() method and as such is thread safe.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!