Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

JSP page directive isThreadSafe

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I don't understand the reason why we have to set the page directive isThreadSafe to false if we want the service method to be thread safe.
I thought that we have to set it to true...
Someone can explain it to me?
Thanks.
Eric
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's bit logical....isThreadSafe is the attribute and if it's set to false that means it's not thread safe. And if it's set to true that means it's thread safe.
Cheers
RajSB
SCJP1.4,SCWCD1.3
 
Eric Benoit
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's what I thought too..
But in Whizlabs, it says that if we set it to FALSE, the service() method will be THREAD SAFE...
It's not logical this way.
So is it Whizlabs who's wrong or what?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Eric,
The logic of using isThread safe is a bit tricky. What it means actually is, when I mark a jsp page with "isThread=true", I say to the container that, "I have developed my jsp in a thread safe manner, so you dont have to worry about it(by implementing the SingleThread interface)". However, if you say "isThread=false", the container steps in and implements the SingleThreadModel for your jsp and thus tries to make it thread safe. I hope this helps.
Regards,
Vijay
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic