How to make servlet thread safe?

Answer Posted / monkyspiderpig

The only thing you need to do is to define only static
variables at Class level. When a method is called each
thread gets a new variable.

Is This Answer Correct ?    8 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we refresh servlet in client and server side automatically?

602


What's the difference between authentication and authorization?

556


What is the difference between the include() and forward() methods?

580


What is the dispatcher servlet?

522


What is setattribute in servlet?

570






What are the key methods that are involved in processing of http servlets?

638


How can I send user authentication information while making URL Connection?

553


What do you mean by chaining in servlet?

582


Explain mvc pattern.

598


What is the GenericServlet class?

614


When to use doget() and when dopost()?

637


explain the advantages of servlet life cycle?

566


What are different ways for servlet authentication?

575


If a servlet is not properly initialized, what exception may be thrown?

633


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

557