Such servlets indicate this desire by implementing the ngleThreadModel interface.
the, servlet Specification JSR-315 clearly defines the web container behavior in the service (and doGet, doPost, doPut etc.) methods ( Multithreading Issues, Page 9 "A servlet container may send concurrent requests through the service method of the servlet.
This is an empty, tag interface that defines no methods or variables and serves only to flag the servlet as wanting the alternate life cycle.
Main, java SE Development.Few servlets may require this to implement.Then, where the SingleThreadModel concept comes?public class SingleThreadConnection extends HttpServlet implements SingleThreadModel Connection con null; / database connection, one per pooled servlet instance public void init(ServletConfig config) throws ServletException it(config / Establish the connection for this instance con establishConnection tAutoCommit(false gta 4 frauen treffen public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException tContentType.It is strongly recommended that Developers not synchronize the service method (or methods dispatched to it) in these circumstances because of detrimental effects on performance".Does it load another Servlet with a separate process initiated (like CGI/perl) or the same process being executed serves the request?For servlets not implementing the SingleThreadModel interface, if the service method (or methods such as doGet or doPost which are dispatched to the service method of the HttpServlet abstract class) has been defined with the synchronized keyword, the servlet container cannot use the instance pool.By this you can understand, the practical approach is to use synchronization and not single thread model.Okay, it is fine everyone knows.As of Java Servlet API.4, with no direct replacement.When SingleThreadModel is implemented, the Servlet container gives guarantee that only one request is honoured or handled at a time by one servlet object.Finally define SingleThreadModel interface?A Great Set of Java.