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 java gui?

501


What is component contract?

526


What is event in java?

471


What is declarative security ?

572


On which platform j2ee is based?

525






What is main method in java?

504


What does j2ee stand for?

478


What is document?

524


What do you understand by business logic?

502


Describe the file types *.ear, * .jar and *.war?

508


What is callback methods?

534


What is callback methods Component methods called by the container to notify the component of important events in its life cycle?

531


What are the modules of j2ee?

505


What are different modules in spring?

523


Is advanced java and j2ee same?

467