Can a programmer control the number of instances for servlet & JSP by specifying no. in any tag in deployment descriptor?
Originally posted by Praful Thakare:
If you are not implementing single threaded modle then only one instance of Servlet or jsp (converted to servlet) will serve all the requests.
Originally posted by Shrinivas Mujumdar:
can we control no. of instances those are created by Server in case of Instance Pooling by specifying some no. in Deployment descriptor?
Originally posted by Shrinivas Mujumdar:
Well, i am not talking about SingleThreadModel. in normal case can we control no. of instances those are created by Server in case of Instance Pooling by specifying some no. in Deployment descriptor?
thanks.
Originally posted by Shailesh Chandra:
Well I haven't tried this ...
1. Create a class level variable.
2. Verify against no. of instances /Increment it by one in constructor of class.
3. If variable is exceeding no. of instances to be expected throw an custom exception from your cunsturctor that no more instance can be created.
typically all the request are entertained by only one instance of the servlet.