+91 9760014754


          Limitations of Servlet-

            Servlet as a technology of Web Application Development has following Drawbacks.

1)HTML is Generated from the program which results in maintenance problem because HTML need to be changed whenever presentation is changed.

2)Development of Servlet is a tiresome process because  Application Programers need to write All the HTML to the Output Stream.

3)Developing web applications using servlet is unproductive i.e. a lot of code need to written even for simple tasks.

4)A servlet is responsible for dynamic content generation as well as presentation. This intermixing of dynamic content generation logic with the presentation logic, creates maintenance problem.

                     Each time presentation (HTML) is changed, Servlets need to be modified.

JSP and the automation of servlet

Java Server Pages (JSP) is the extension of servlet which facilitate productive development of dynamic web applications in Java.


 JSP removes the  drawbacks of servlets by completely changing the web application development model.

 In a servlet, HTML is generated from the program whereas in JSP, request processing logic is written to the HTML with the help of special tags.

 Each JSP page is translated by the server into a servlet

Description of the diagram:

1.0 – Client sends first request for a JSP page.

1.1 – Using the JSP page a servlet is generated by a server component. This servlet contains the request processing logic of the JSP and auto generated statements to write the static HTML contents to the output stream.

1.2 – The translated servlet is compiled.

1.3 – An object of the generated servlet class is created and initialized.

1.4 – Request processing method _jspService(request,response) is invoked on the servlet object.

1.5 – Contents dynamically generated by _jspService(request,response) method, are sent as response to the client.

2.0 – Subsequent requests are sent for the JSP page.

2.1 – Servlet object created for the JSP is identified.

2.2 – Request processing method _jspService(request,response) is invoked on the servlet object.

2.3 – Contents dynamically generated by _jspService(request,response) method, are sent as response to the client.

Note:- If a JSP page is modified after translation then its servlet is regenerated when next request is sent for it.


  • JSP and the automation of servlet:

  • Both These problems of Servlet are removed by JSP.
  • JSP is an Extension of Servlet Which Simplifies WebApplication Development  by facilitating embedding of  request processing Logic(java Code/Dynamic Content generator code) into HTML.


Following Diagram Describes Processing of Request By JSP.

1.0   Initial Request is Submitted.

1.1    Translated to.

1.2   Compiled.

1.3   Instantiated(Object Creation) & initialized.

1.4, 2.2  _jspService( ) method is invoked  Which process results and Generates Contents

1.5, 2.3  Contents Generated by _jspService( ) are sent as Response.

2.0 Subsequent request

2.1  Servlet object for the JSP is identified.



  • Advantages of the JSP over servlet:


1. JSP increases the productivity of the application programmers as they are only required to provide the processing logic. All the repetitive tasks such as defining classes & request processing methods, and writing static HTML                  contents to the output stream, are automated.

2. Maintenance is simplified. Static HTML contents or request processing logic can be changed on the fly because of the automated translation.

3. You can now appreciate the ease of development offered by the JSP but for that you need to understand the relation of _jspService(request,response) method to the servlet. In servlet, there was no such method!