JSP Tutorial

Java Server Pages (JSP) is a server-side technology used to create static and dynamic web applications. The static content is expressed by text-based format files such as HTML, XML, SVG whereas JSP elements are used to construct dynamic content.

JSP is a convenient way of writing servlets. It enables you to insert Java code into HTML pages through simple JSP tags. JSP source files are represented by .jsp extension.

Difference between Servlet and JSP

JSP

Servlet

JSP files are represented by .jsp extension.

Servlet files are represented by .java extension.

JSP code can be inserted into HTML page.

Servlet code cannot be inserted into HTML page whereas vice-versa is possible.

JSP contains in-built implicit objects.

In Servlet, the required objects are called explicitly.

JSP is an easy language as it contains less code and deals maximum with tags.

Servlet contains a heavy bug of java code.

While compilation, JSP code is initially converted into Servlet. So, the execution of JSP page takes much more time than Servlet.

The execution of Servlet code is faster than JSP.

JSP Features

Some key features of JSP technology are as follows:

  • Portable - JSP is a platform independent technology. So, JSP web pages can run on any browser and web container independently.
  • Simple- It provides an easy way to develop and deploy web applications.
  • Powerful - JSP is a Java based technology. Thus, it is secured and robust.
  • Tag based approach - Instead of heavy bug of java code, JSP uses simple pre-defined tags.
  • Customized tag - JSP also allows users to define their own tag.

JSP Tutorial