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
Can we fetch the attributes related to a servlet on a different servlet?
Is servlet a controller?
What is meant by cookies?
How the typical servlet code look like ?
What do you mean by singlethreadmodel interface?
What are some advantages of storing session state in cookies?
Why do we have servlet listeners?
When a servlet accepts a call from a client, it receives two objects. What are they?
Explain the features are in servlet 3?
What is the need of servlet filters?
What do you mean by httpservlet and how it is different from the genericservlet?
What are different ways for servlet authentication?
What do you mean by mime type?
Define the life cycle of a servlets.
Can filter be used as request or response?