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
What are the components of j2ee?
What is bean factory, have you used xmlbean factory?
How do you compile java?
What is build tool in java?
What is credentials?
Where is java used?
What is data?
What is java api for xml registries (jaxr)?
What is jaxr client?
What is application configuration resource file?
What is tomcat in j2ee?
What is the difference between load() and get()?
What is a j2ee component?
What is certificate authority?
What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?