Why we need to Use JSP instead of CGI
by, 07-07-2012 at 08:03 PM (1907 Views)
Java Server Pages and Common Gateway Interface (CGI) usually provide the same program functionality. But there are few advantages or features only offered by the Java Server Pages.
• JSP provided support to use and embed expressions and dynamic elements in HTML page. Where as in CGI, a separate CGI file is used for the same purpose. Thus Java Server Pages provides better performance as compared to CGI.
• A JSP page is compiled by the web server before it is processed or invoked. Where as in CGI the web server will load an interpreter and it will interpret the script each time page is called by the client.
• Java Servlet API is the base for Java Server Pages and JSP pages are built on top of it. So just like Servlets, Java Server Pages has also access to all the powers of Java like EJB, JDBC, JNDI, JAXP etc.
• JSP and Servlets can also be used together where Servlet will be at backend and handles core business logic and JSP will provide the front end for applications.
Java Server Pages are a core and integral part of J2EE which is a very powerful and complete enterprise platoform. So the Java Server Pages has a role in simple and complex application which has more demand in the market.