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
What is a deployment descriptor?
When jsessionid is created?
What do you mean by filter in servlet?
How is a servlet implemented in code?
Name the packages that work with servlet?
Is servlet synchronized?
What is a servlet engine?
How can we implement a jsp page?
What is http servlet?
Write a command to get actual path of a servlet to the server?
How can you push data from an Applet to a Servlet?
What are the advantages of servlets over traditional cgi?
What is the use of welcome-file-list?
How forward () method is different from send redirect () method?
How do I support both get and post from the same servlet?