JSP Tutorial

tutorial and example
tutorial and example

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.


Index Title
Tutorial JSP Life Cycle
Tutorial Scripting in JSP
Tutorial JSP Scriptlet Tag
Tutorial JSP Declaration Tag
Tutorial JSP Expression Tag
Tutorial JSP Comments
Tutorial JSP Directives
Tutorial JSP Taglib Directive
Tutorial JSP Include Directive
Tutorial JSP Page Directive
Tutorial JSP Control Statements
Tutorial JSP Implicit Objects
Tutorial JSP out
Tutorial JSP Request
Tutorial JSP response
Tutorial JSP config
Tutorial JSP application
Tutorial JSP session
Tutorial JSP pageContext
Tutorial JSP page
Tutorial JSP exception
Tutorial JSP Action Tags
Tutorial JSP forward and include tag
Tutorial JSP useBean, getProperty and setProperty tags
Tutorial JSP Cookie Handling
Tutorial JSP Expression Language
Tutorial JSP EL Implicit Objects
Tutorial JSTL – Java Standard Tag Library
Tutorial JSTL Core Tags
Tutorial JSTL Formatting Tags
Tutorial JSTL SQL Tags
Tutorial JSTL XML Tags
Tutorial JSTL Function Tags
Tutorial JSP Custom Tag

Difference between Servlet and JSP



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.