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 / archana
When u create a servlet with a constructor it wont be a
complete servlet but will be in a akward state where it
cannot access Servlet Context and Config.It has to go
through the init() method (though we dont know what code is
written there) to be a complete servlet
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is servlet in tomcat?
Why don't we write a constructor in a servlet?
What is the dispatcher servlet?
What do you mean by servlet?
Which are the different ways you can communicate between servlets?
Does servlet have main method?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What is session tracking?
What is a servlet engine?
What is the use of httpservletresponsewrapper?
What are the differences between forward() method and sendredirect() methods?
What is a generic servlet?
How does java thread pool work?
What is the use of request dispatcher interface?
Explain url encoding in servlet?