• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is JSTL thread-safe?

 
Jerome Mrozak
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create a JSP file with
which creates a servlet without the interface. I am using JSTL tags.

The servlet contains instance variables such as:


which are filled in the method with


and such. I get the same code whether "isThreadSafe" is set true or false.

So, are the objects pointed at safe for multiple-threads? Especially since SingleThreadModel is deprecated?

Thanks in advance,

Jerome.
[ July 19, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jerome Mrozak:
I get the same code whether "isThreadSafe" is set true or false.


You misundestand the meaning of the isThreadSafe attribute.

Whether it is set or not will not result in any diffent code generated on behalf of your JSP, but in how the container dispatches requests to that generated servlet.

Read the info in the JSP 2.0 Spec (page 1-47) for the details.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. You can be assured that the container knows what it's doing with regards to thread safety.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!