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

Answer Posted / n.l.narayana

yes., when ever the servlet is executed .,it requires
configuration.,the configuration should be done in init()
method only.,

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is servlet container?

667


I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2534


Which are the different ways you can communicate between servlets?

532


What is the need of servlet filters?

543


What are the servlet events?

594






How do you run a servlet?

548


List out difference between a JavaBean from a Servlet?

568


Which HTTP method is non-idempotent?

618


Explain web application directory arrangement?

593


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

553


Write a simple servlet program to print the contents of html.

553


What is lazy loading and what is Generic Servlet Class?

611


What are the phases of servlet life cycle?

611


When should you prefer to use doget() over dopost()?

665


What is the difference between the include() and forward() methods?

573