can servlet have instance variables?

Answer Posted / rajashree

The servlet you write can be used simulataneously by many
users at the same time and each user of the servlet has a
thread. Consider the user and the session one and the same.

Avoid instance variables. An instance variable is any
object owned by a a class. There will be only one of these
per class - not one per user. In general, you can not have
a user modify an instance variable because other users are
also using the same variable.

Is This Answer Correct ?    35 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need servlet filter?

789


Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com

1944


What is servlet in tomcat?

792


Which method of the httpservletrequest object is used?

788


What are the two important api's in for servlets?

811


How to read request headers from servlets?

808


Can we override servlet service method?

838


Explain the servlet filter.

737


Explain the architechure of a servlet?

852


Explain servlet.

791


What are life cycle methods of a servlet?

798


How to generate the server side programming and the advantages of it over the other languages?

788


How many objects of a servlet is created?

1012


Can you use javascript in servlets?

823


What if you need to span your transaction across multiple servlet invocations?

810