Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Hi Single thread model is used to enforce one request accessing servlet at a time . Servlet Api says, container may decide to have multiple instances of servlet if SingleThreadModel is implemented. can we have more than one instance of a servlet in a container
~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
A servlet can have more than one instances in the JVM. The number might be configured. SingleThreadedModel indicats that at a time only one request will be allowed to access the one instance's service() method. Effectively it means that the service() method is synchronized. Note : There might be more than one instances in SingleThreadedModel and more than one requests serviced. But only one request per instance.
To quote from the Servlet API 2.3 - section 2.2 "For a servlet not hosted in a distributed environment (the default) the servlet must use only one instance per servlet declaration." It then goes on to discuss the exception of the SingleThreadModel. You really should get a copy of the API to answer these questions - it is the final authority. Bill
Liar, liar, pants on fire! refreshing plug:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth