Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?

Answer Posted / ravikiran

we cann't write a constructor because the servlet container
will create the instance of the servlet by calling the
no-arg constructor

Is This Answer Correct ?    1 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

622


What is war file?

583


What are the servlet events?

594


What is the purpose of dispatcherservlet properties?

512


What is the procedure of invoking different servlet in a different application?

563






What is URL Encoding?

627


How can a servlet be used to generate plain text instead of html?

549


What do you mean by cgi?

534


What are the types of protocols supported by httpservlet ?

708


What is servlet in simple terms?

574


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

580


Explain jsessionid and when is it created?

597


Name the different ways of session tracking.

573


What is the workflow of a servlet?

721


What is servlet lazy loading?

697