• Post Reply Bookmark Topic Watch Topic
  • New Topic

isThreadSafe

 
Jack Lau
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am very confuse that why if jsp page use isThreadSafe="false", the container will dispatch the request to the page one at a time in order but if jsp page use isThreadSafe="true", the generated servlet does not implement SingleThreadModel? It seems different from servlet...

Could anyone tell me why?

Thanks,
Jack
 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jack Lau:
Hello All,

I am very confuse that why if jsp page use isThreadSafe="false", the container will dispatch the request to the page one at a time in order but if jsp page use isThreadSafe="true", the generated servlet does not implement SingleThreadModel? It seems different from servlet...

Could anyone tell me why?

Thanks,
Jack


1) Thread safe - allows multiple sumultaneous requests to one instance
a) servlets: is servlet thread safe ? yes - DO NOT implement SingleThreadModel
b) JSPs : is JSP thread safe ? yes.
isThreadSafe ? true.
DO NOT implement SingleThreadModel

2) NOT thread safe - allows only one request to one instance in one moment
a) servlets: is servlet thread safe ? no - implement SingleThreadModel
b) JSPs : is JSP thread safe ? no.
isThreadSafe ? false.
implement SingleThreadModel
 
Whatever. Here's a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!