What is Single Threaded Model in Servlets? Explain this
with an example?

Answer Posted / devarathnam

Hi... Actually "SingleThreadedModel" is a marker
interface,which doesnot contain any methods.By default
servlet is multithreaded.If u want to make this as single
theaded u can implement this interface in the following
fashion.
public class SingleThreadedTest implements SingleThreadModel
{
//some code
//....
//....
//....
}It is Thread-safety mechanism on a shared resource.

Is This Answer Correct ?    28 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which event is fired at the time of setting, getting or removing attribute from application scope?

601


What is difference between cookies and httpsession?

542


What are life cycle methods of a servlet?

583


Explain servlet life cycle?

606


Explain how does JSP handle run-time exceptions?

574






Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com

1732


What do you mean by web applications?

618


What are different Authentication options available in Servlets.

561


What is the purpose of requestdispatcher interface?

604


How many objects of a servlet is created?

781


What are the important functions of filters?

587


How can we upload the file to the server using servlet?

538


How to get the current httpsession object?

644


Difference between GET and POST?

700


What do you mean by annotations in servlet?

574