Difference between servlet service and jsp service

Discussions

General J2EE: Difference between servlet service and jsp service

  1. Hi all

    please tell me the difference between the servlet service and jsp service method.
  2. Hi allplease tell me the difference between the servlet service and jsp service method.

    As JSP s are converted into servlet classes, functionally there is no difference between both the methods. Only difference i expect is JSP s are HTTPServlet where as servlet is either GenericServlet or HTTPServlet. So JSP service method always contains the parameters HTTPServletRequest and HTTPServletResponse. In case of HTTPServlet, service method is doPost or doGet etc and contains parameters HTTPServletRequest and HTTPServletResponse. In case of GenericServlet parameters of service method are ServletResponse and ServletRequest. In servlets these methods throw ServletException.
  3. It's how you want to build your page. If you want to create an html page with some code in it - use JSP. If you want to write a program that has html in it, write a servlet.

    - dave