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 exceptions thrown by servlets? Why?
What are life cycle methods of a servlet?
What is servlet container?
What's the difference between servlets and applets?
What do you mean by servlet context?
What is the advantage of Servlets when compared with other server side technologies?
What is the procedure of invoking different servlet in a different application?
How can we include static files in the jsp page?
How can we invoke another servlet in a different application?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
What are the types of protocols supported by httpservlet ?
What are the life cycle methods of a servlet?
What must be implemented by all servlets?
Can you use javascript in servlets?
Is servlet a framework?