Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / tharun raj
yes, we can provide a constructor in servlet calss..
Webcontainer uses the similar code shown below for creating
servlet object for our servlet class
Class c=Class.forName("OurServlet");
Object o=c.newInstance();
this newInstance() method uses zero argument constructor
while creating object..
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
Explain the war file?
What is the difference between get and post methods?
Explain the difference between servletconfig and servletcontext in servlet?
What is ServletConfig object?
What is life cycle of Servlet?
Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com
Why servlet is used as controller ? Not JSP? I want complete explation?
What do you mean by singlethreadmodel interface?
What is the difference between portlet and servlet?
What is the GenericServlet class?
How can we perform any action at the time of deploying the project?
What is the need of session tracking in web application?
What is http servlet? Explain with the help of an example.
When to use doget() and when dopost()?
What is the major difference between context parameter and context attribute?