Latest web development tutorials

JSP Introduction

What is Java Server Pages?

JSP stands for Java Server Pages, is a dynamic web development technology. It uses JSP tags to insert Java code in HTML pages. Tags typically <% start with end with%>.

JSP is a Java servlet, mainly used to implement Java web application's user interface section. Web developers who through a combination of HTML code, XHTML codes, XML elements and embedded operating JSP and commands to write JSP.

JSP get user input data, access databases and other data sources through web forms, then dynamically create web pages.

JSP tag has a variety of functions, such as access to the database, the user selects the record information, visit JavaBeans components, etc., can also pass control information and share information on different pages.


Why use JSP?

JSP program with CGI programs have similar functions, but in comparison, and CGI programs, JSP program has the following advantages:

  • Superior performance, because JSP elements can be dynamically embedded directly in HTML pages without the need for a separate reference CGI files.
  • Server call is already compiled JSP file, rather than the CGI / Perl interpreter that must be loaded and the target script.
  • JSP-based Java Servlets API, therefore, JSP has a variety of robust enterprise-level Java API, including JDBC, JNDI, EJB, JAXP, and so on.
  • JSP pages can be used with servlets handle business logic, this model is supported by Java servlet template engine.

Finally, JSP Java EE is an integral part of a complete enterprise application platform. This means that the JSP can use the simplest way to achieve the most complex applications.


JSP advantages

Here are other benefits brought about by the use of JSP:

  • Compared with ASP: JSP has two advantages. First, the dynamic part is written in Java, instead of VB or other MS-specific language, it is more powerful and easy to use. The second point is JSP easy portable to non-MS platform.
  • Compared with pure Servlets: JSP can easily write or modify HTML pages without having to face a lot of println statements.
  • Compared with SSI: SSI form data is not available and can not be a database link.
  • Compared with JavaScript: Although JavaScript can generate HTML dynamically on the client, but it is difficult to interact with the server, and therefore can not provide complex services, such as database access and image processing, and so on.
  • Compared with static HTML: Static HTML does not contain dynamic information.

what's next?

We will take you step by step to build JSP operating environment, which requires a certain Java base.

If you have not learned Java, we can offer you first learn the Java tutorials .