Servlet is also java program but there is no main method in servlet.Who will take role of main method on servet.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Servlets are designed to run inside a servlet container (eg. Apache Tomcat). Execution of a servlet happens in the following manner: The servlet container calls the
GenericServlet.service()method on a servlet which typically calls the appropriatedoXxx()method, eg.doGet(),doPost(), etc. ThedoXxx()method is responsible for interpreting the HTTP request and serving an appropriate response.GenericServlet.service()is roughly analagous tomain()in a plain old java class.