In JSP, special tags are used to embed
dynamic content generation code into a HTML
Following types of tags are used in JSP:
1. Scriptlet Tag
2. Declaration Tag
3. Expression Tag
4. Directive Tag
5. Action Tag
All the statements which are placed within
scriptlets are moved to _jspService() method with
Auto Generated Servlet at the time of translation.
Within a scriptlet following implicit objects
are made available to a JSP programmer:
* represents, is not available by default in all JSP pages.
This tag is used to define data members &
methods in the Auto Generated Servlet.
This tag is used to write a String or String
returning expression to the Output Stream. In
other words, this tag provides a shorthand
mechanism of writing strings or String
returning expressions to output stream.
Directives Tags are used to provide
information to the JSP translator. This
information is used by the translator at the
time of creating Servlet from the JSP.
There are 3 types of directives in JSP:
1. page directive
2. include directive
3. taglib directive
This directive is used to provide information
such as base class for Auto Generated Servlet,
packages to be imported, content type to be
set, URL of error handler page etc.
Syntax<%@ page attribute=“value” %>
This directive is used to include the contents
of a resource to the response of current JSP.
file=”URL of Resource” %>
taglib directive is used to specify the location of a
TLD (Tag Library Descriptor) file that defines many
Syntax<%@ taglib uri=“uniqueIdentifier/path of tld file” prefix=“prefixOfTagLibrary” %>
Example<%@ taglib uri=“http://www.rupendra.co.cc/tags” prefix=“mytag” %>
We will use this tag in custom tag section so it will
be better to learn it in custom tag.
This tag is used to generate code within
_jspService() method for performing some
action such as creating an object, setting its
properties, including the contents of the
resource, forwarding the request to another
The action tags basically are used to control
the flow between pages and to use java