single thread model

Posted on 2006-05-20
Medium Priority
Last Modified: 2010-04-01
could you explain single thread model in jsp

difference between servlet and jsp
  • 2
  • 2

Expert Comment

ID: 16725609
I could go into a long shpeil about the life cycle from different stand points, however I believe the authos do a great job themselves:


Expert Comment

ID: 16725611
Oopsie, that was meant for another question, sorry about that.
LVL 35

Accepted Solution

TimYates earned 400 total points
ID: 16732370
In JSPs you can put:

    <%@ page isThreadSafe="false" %>

which makes it implement SingleThreadModel

As JSPs are converted to servlets by the container, there is no difference between the two...

And as a rule, DON'T use SingleThreadModel...  It is deprecated...  as it says in the API docs:


Interface SingleThreadModel

Deprecated. As of Java Servlet API 2.4, with no direct replacement.


Note that SingleThreadModel does not solve all thread safety issues. For example, session attributes and static variables can still be accessed by multiple requests on multiple threads at the same time, even when SingleThreadModel servlets are used. It is recommended that a developer take other means to resolve those issues instead of implementing this interface, such as avoiding the usage of an instance variable or synchronizing the block of the code accessing those resources. This interface is deprecated in Servlet API version 2.4.

Author Comment

by:Manikandan Thiagarajan
ID: 16732498
Advantages of single thread model
LVL 35

Expert Comment

ID: 16732544
don't use it

it doesn't work right

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question