Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

threadsafety in JSP

 
Abhi Jh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a class which returns an Arraylist in a jsp.
I was wondering if it will be threadsafe or not - since I was not very sure if the particular arraylist shows up as an instance variable or a method variable in the jsp instance..
code in the jsp:
dataCommand = new GetIdeasByOfferNamesValueOfferName );
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although your question and code example are not very detailed, you will not have threading issues in a JSP as every variable (declared in scriplet) is method local.
Also, if you are saying "new", every thread will be creating a new instance, and is inherently thread-safe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic