Hi guys.. Well can u tell me that why there is need of
"init()" , i mean why can not we initialize the servlet object
with the help of constructors?
Thank you.
Answer Posted / manas banerjee
you can use but should not.the original reason for init()
was that ancient version of java could not dynamically
invoke constructors with arguments.so there was no way to
give the constructors a ServletConfig.So u would not have
to access to ServletConfig or ServletContext.
{{in short:init() has access to servletconfig and
servletcontext object constructor would not..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can we achieve transport layer security for our web application?
What is servlet looping or chaining?
What are the common methods that are included in the http servlet class?
How the typical servlet code look like ?
How do we translate jsp?
Which application server is best for java?
What do you mean by servlet?
What exactly is a servlet?
What are all the protocols supported by httpservlet?
Explain get and post.
How can the session in servlet be destroyed?
Explain the different ways for servlet authentication?
What do you mean by the servlet chaining?
What is the use of attribute in servlets?
What do you mean by httpservlet and how it is different from the genericservlet?