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 use the constructor, instead of init(), to initialize servlet?
What is the advantage of Servlets when compared with other server side technologies?
If a servlet is not properly initialized, what exception may be thrown?
Can you explain in detail 'javax.servlet' package?
Explain load on start-up and its importance?
Explain web application directory arrangement?
What do you mean by scope object and what are its types?
Explain their methods? Tell me their parameter names also have you used threads in servlet?
How do you load an image in a Servlet?
Can we use threads in Servlets?
What does the term localization refer to?
What are the types of Session Tracking ?
What do you mean by url pattern in servlet?
I Have A Plan to develop a Project in Struts,I want the template of struts project with Hibernate.Canany body provide me the required information?
What are the kinds of http requests?