16
I have a servlet which looks like :
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
doTheJob(request, response);
}//method doGet
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
doTheJob(request, response);
}//method doPost
private void doTheJob(.....) {
...........................
}
}
Because of the way my application works, I only need to call doTheJob() both from doGet() and from doPost(). So I think, I better override the method service() of the HttpServlet.
But I would like to know if that will brake anything or will cause any issues.