Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronize JSP  RSS feed

 
Hussain Fakhruddin
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

How can i synchronize a JSP.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That greatly depends on why you feel you need to do that.
 
Hussain Fakhruddin
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean like in servlet we can use SinglThreadModel what can we do in the case of JSP.

That greatly depends on why you feel you need to do that.


This question was asked to me in the Interview.
 
Heonkoo Lee
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP provides a means to turn off threading through the page directive attribute, <%@ page isThreadSafe="false" %>. This forces the page to be created under the SingleThreadModel, which allows only one request to be handled by the page at a time.

This option is not 100% effective. Variables created in the session or application scope may still be affected by multiple instances.

It is not recommended to use SingleThreadModel in the recent servlet spec.
 
Hussain Fakhruddin
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Heonkoo Lee
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!