JSP ARCHITECTURE

JPS pages are high level extension of servlet and it enable the developers to embed java code in html pages.

JSP ARCHITECTURE

JSP ARCHITECTURE

     

 JSP pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled into a servlet by the JSP engine. Compiled servlet is used by the engine to serve the requests.

javax.servlet.jsp package defines two interfaces:

  • JSPPage

  • HttpJspPage

These interfaces defines the three methods for the compiled JSP page. These methods are:

  • jspInit()
  • jspDestroy()
  • _jspService(HttpServletRequest request,HttpServletResponse response)
      

In the compiled JSP file these methods are present. Programmer can define jspInit() and jspDestroy() methods, but the _jspService(HttpServletRequest request,HttpServletResponse response) method is generated by the JSP engine.