Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Doubt abt Page directive

Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If <%@page isThreadSafe ="true" %>.
then SingleThreadModel is not implemented i.e. multiple thread can execute meaning obhects are not thread safe..Doesn't the attribute isThreadSafe value a different meaning.
Author & Gold Digger
Posts: 7617
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the JSP Specification 2.0

JSP 1.10.1 Page Directives
isThreadSafe Indicates the level of thread safety implemented in the page.
- If �false� then the JSP container shall dispatch multiple outstanding client requests, one at a time, in the order they were received, to the page implementation for processing.
- If �true� then the JSP container may choose to dispatch multiple outstanding client requests to the page simultaneously. Page authors using �true� must ensure that they properly synchronize access to the shared state of the page. Default is �true�.
Note that even if the isThreadSafe attribute is �false� the JSP page author must ensure that accesses to any shared objects are properly synchronized., The objects may be shared in
either the ServletContext or the HttpSession.

Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isThreadSafe="false" generates a servlet which implements the SingleThreadModel interface.

isThreadSafe="true" means the servlet container is not responsible for the thread issue, but your JSP is. So the servlet generated does not imlement the SingleThreadModel interface
My 2 cents.
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic