You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
have access to post topics
communicate privately with other members (PM)
not see advertisements between posts
have the possibility to earn one of our surprises if you are an active member
access many other special features that will be introduced later.
Even though we have a service() method in servlets, why do we go for a doGet() or a doPost() method? Is there any advantage of these doGet and doPost over service() method?
service method is in GenericServlet,
doGet, doPost are methods in HttpServlet(extends GenericServlet).
Generally HttpServlet is used for applications wherever http protocol is used