Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


What are JavaServer Pages?

Educative Answers Team

JavaServer Pages (JSP) is a technology used to develop different webpages that support dynamic content. This technology helps developers insert Java code in HTML pages by making use of special JSP tags, most of which start with <% and end with %>.

JSP can be used to collect input from users through webpage forms, present records from a database or any other source, and create dynamic webpages.

JSP tags can be used for a variety of purposes, such as retrieving information from a database or registering user preferences, accessing JavaBeans components, passing control between pages, and sharing information between requests, pages,​ etc.

JSP architecture

The illustration below is of the JSP architecture:

svg viewer

Why use JSP?

JavaServer Pages often serve the same purpose as programs implemented using the Common Gateway Interface (CGI). However, JSP has several advantages over CGI.

  • JSP’s performance is significantly better because it allows dynamic elements to be embedded into HTML pages instead of into separate CGI files.

  • JSP’s are always compiled before they are processed by the server. CGI/Perl, on the other hand, requires the server to load an interpreter and the target script each time the page is requested.

  • JSP’s are built on top of the Java Servlets API so, like Servlets, JSP also has access to all the powerful Enterprise Java APIs including JDBC, JNDI, EJB, JAXP, etc.

  • JSP pages can be used in combination with servlets that handle business logic (the model supported by Java servlet template engines).


Copyright ©2022 Educative, Inc. All rights reserved

View all Courses

Keep Exploring