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
How can we refresh automatically when new data is entered into the database?
What's the architecture of a servlet package?
What are the functions of an intercepting filter?
Which httpsession object is used to view and manipulate information about a session?
What is servlet configuration?
Can we override servlet service method?
Name the different ways of session tracking.
Which interface must be implemented by all servlets?
Is servlet thread safe?
Which event is fired at the time of session creation and destroy?
What is url encoding and url decoding
Which java framework is most popular?
What is the default http method in the servlet?
How native code can be used in a servlet?
What are Servlets?