servlet has not any main method in it how does it work by
JVM?

Answer Posted / nishita

The request mapping is done in web.xml which maps URL to
the Servlet which should handle the request. When the user
hits the URL on the browser, the request is redirected to
Webserver from the code. The Web container decides which
Servlet to call based on the mapping in Web.xml. This
servlet (if it was not loaded at server startup) will first
get loaded then, it gets instantiated and then its init()
method is called. This is called only once. The
initialization happens here. After that the servlet is
ready for service, service() method is called. The service
() method can be called any number of times. Hence, without
a main method the servlet is called.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multi tier architecture in j2ee?

526


Why awt is used in java?

576


What is certificate authority?

642


What are the components of j2ee applications?

656


Why tomcat is used in java?

568






What are j2ee technologies?

525


What is japplet in java?

582


What is java naming and directory service?

607


What is java ee used for?

526


i want test pattern of zylog company and some examples also

2386


What is archiving?

618


What is component in java with example?

565


What is document?

614


What is setfocusable in java?

684


Give some advantages of orm (object-relational mapping)?

627