When many Users are browsing the same application at the same time and they click the "Submit" button will many objects be created for each and every User?

Showing Answers 1 - 6 of 6 Answers

pavan

  • Mar 31st, 2006
 

when we implement  SingleThread Model one object will be created for every request, otherwise only one object will be created irrespective of the number of requests.

  Was this answer useful?  Yes

SingleThreadModel is now deprecated.

Whenever more than one user hits Submit button, server created thread of the servlet, which made after compilation, and runs its _jspService() method to response him.

As Pavan said we can create our servlet thread safe by making synchronized the service method.

  Was this answer useful?  Yes

prabhaker

  • May 19th, 2006
 

It's depends on the service method of the servler.

If it implements single thread model ,the container mey queying the requests or picking the instance from the pool.

otherwise for each and every upcoming request it will gives the response in different service threads,means for each request it will execute in diff thread.

  Was this answer useful?  Yes

umar farooq

  • Jul 24th, 2011
 

NO, There will be one single instance of the servlet in the web-container ,when request arrives to the server a thread will be created rather creating the object. so that multiple request will have multiple thread. so here easily we can understand the scalable feature of webcontainer. where as in CGI program each request will result in creating the object..multiple request will have multiple object..

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions