Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / abhishek taneja
yes offcourse you can write a constructor for a servlet
after all it is a java class. you can simply provide but if
u do not provide then it is by default include the no
argument constructor that is used by the Init() method in
the servlet life cycle.
Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What are the types of an http request?
Define the lifecycle for executing a jsp page.
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
What is the structure of the http response
What is getservletcontext?
Can you refresh servlet in client and server-side automatically?
How the servlet is loaded?
Write the code to get the server information in servlet.
Explain request dispatcher and its methods.
What is cgi and what are its drawbacks?
What is the use of httpservletrequestwrapper and httpservletresponsewrapper?
Tell us something about servletcontext interface.
How is a servlet implemented in code?
What are the steps that are required to handle the multi-threading?
Describe some assignments that are executed by servlet container?