Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Plz Explain isThreadSafe attribute of the page directive.

 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody Explain the isThreadSafe attribute of the page directive.

Thanks & Regards,
Saurabh
 
Chandrakanth
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isThreadSafe="true|false".

A value of true (the default) indicates normal servlet processing, where multiple requests can be processed simultaneously with a single servlet instance, under the assumption that the author synchronized access to instance variables.

A value of false indicates that the servlet should implement SingleThreadModel.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say isThreadSafe is true, you are going to take care of multi threads. When isThreadSafe is true there will be on JSP instance serving multiple requests, one thread will be created for each request to acess jsp service method. If isThreadSafe is false, for each request there will be one jsp instance(internally corresponding servlet class for jsp)
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic