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
What is life cycle of Servlet?
Which httpsession object is used to view and manipulate information about a session?
Can you use javascript in servlets?
What are common tasks performed by Servlet Container?
What is the
Explain url encoding?
What do you mean by web applications?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
What is servlet looping or chaining?
Name the packages that work with servlet?
What do you mean by servlet context?
What do you mean by cgi in servlet?
Why is httpservlet declared abstract?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
Explain the jar and war files in servlet?