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 invoke another servlet in a different application?
What is the difference between the servlets and cgi programs?
What is a servlet context object?
What are the steps involved in placing a servlet within a package?
how the HTML data stored in web server?
What is ServletConfig object?
What is the difference between forward () and sendredirect () functions in servlet? Explain
What is SingleThreadModel interface?
List some life cycle methods of a servlet.
How to generate the server side programming and the advantages of it over the other languages?
What is meant by a servlet?
How can you use a servlet to generate a plain text instead of html?
Explain the difference between jsp and servlet?
How do you communicate in between Applets and Servlets?
Is servlet a server side scripting language?