When we don't write any constructor for the servlet, how
does container create an instance of servlet?

Answer Posted / mahesh

Container creates instance of servlet by calling
Class.forName(className).newInstance().

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use threads in Servlets?

656


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

550


Explain jsessionid and when is it created?

597


What are the phases of servlet life cycle?

611


How to get the path of servlet in the server?

542






What is the difference between sendredirect() and forward() in a servlet?

529


How do we translate jsp?

578


How do servlets work?

538


What is meant by Servlet? What are the parameters of service method?

602


What is the use of attribute in servlets?

544


Can we override destroy method in servlet?

506


What are the advantages of servlets over traditional cgi?

632


What is httpservlet and how it is different from genericservlet?

615


What is webservlet?

539


How do you find out what client machine is making a request to your servlet

534