• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt abt Page directive

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 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.
 
JeanLouis Marechaux
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic