My question to you is:
I am retrieving the name of the class (the servlet) by using getClass().getName() so that I can also have a URL to the source file available within the function of the servlet upon request. My question is does this method instantiate the class whose name it is trying to get? If it does thats not good business for the web container that I am using (especially since it's use is being lent to me for free). Its best to let the container handle the lifecycle of the servlet, other wise porblems may occur so I need to be wary of bad design.
Anybody with some advise on that?
Originally posted by Mirko Froehlich:
If you are calling this in a servlet and your question is whether this creates another instance of the servlet, then the answer is no. "getClass()" creates a Class instance, but no instance of the servlet you call it on.
That's exactly what I was asking. I justed wanted to be sure that I am not instantiating the servlet myself, on top of letting the container do it.
Thanks for your help.