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
Describe the phases of servlet lifecycle?
What is the difference between sendredirect() and forward() in a servlet?
how to link html file to sevlet file.one name is textbox,c&c++ is cheakbox,bc&mca is radio button and one submit buttonis ok why in this programme use in servelt file
Explain their methods? Tell me their parameter names also have you used threads in servlet?
What is called Scriptlet?
Which is better jsp or servlet?
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
What is new in ServletRequest interface ? (Servlet 2.4)
How is the get () method different from the post() method?
What are the disadvantages of storing session state in cookies?
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 do you mean by cgi and what are its drawbacks?
How are filters?
What if you need to span your transaction across multiple servlet invocations?