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
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
Explain request dispatcher and its methods.
What are the advantages of servlets over traditional cgi?
What is the major difference between context parameter and context attribute?
Can you send an authentication error from 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
What is session?
Explain the jar and war files in servlet?
Why is a constructor needed in a servlet even if we use the init method?
How a servlet is unloaded?
How is the get () method different from the post() method?
What's the difference between authentication and authorization?
What are the differences between servlet context vs servlet config?
What are different Authentication options available in Servlets.
How are filters?