Can we define constructor in Servlet class?

Answer Posted / sanjeev kumar

We never can create the Servlet instance. hence there is no
chance of having constructor in servlets. Servlet life
cycle methods (init(), service(), destoy())are called by
the servlet container.

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a command to get actual path of a servlet to the server?

541


What do you mean by httpservlet?

568


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

2920


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

577


What is the use of request dispatcher interface?

571






Servlet is pure java object or not?

719


What do you mean by request dispatcher in servlet? Also explain its methods.

611


Is it good idea to create servlet constructor?

744


Which exception is thrown if the servlet is not initialized properly?

594


How to handle exceptions thrown by application with another servlet?

617


how the HTML data stored in web server?

1955


How can we achieve transport layer security for our web application?

573


What are the life cycle methods of a servlet?

595


What is http servlet?

584


What are the types of an http request?

585