Typically, a servlet class is instantiated the first time it is invoked. The same instance will be used over several client requests, so all members that are declared in that servlet are shared accross clients. :There is no such interface as MultiThreadedModel. Servlets are intrinsically multithreaded. This means a single instance can be accessed by more than one thread.:That is what is meant by multi threaded model, multiple clients that access the same instance. There are situations where you want to protect yourservlet member variables from being modified by different clients.:two servlets acted in the server side process:if the servlet implements multi threaded model,container executes service() method concurrently in multiple threads.:Servlet is not thread safe.we need to make it is threadsafe we can goto SINGLE INSTANCE MULTIPLE THREADS MODEL.:in multi threaded model multiple threads are acting on the service method concurrently, where as in single thred model only one thread will execute the service method,while the remaining threads are waiting:two servlets are running in the server side process
Category:Servlet Interview Questions
No comments:
Post a Comment