Jsp directive elements
• The jsp directives are messages that tells the web container how to translate a JSP
page into the corresponding servlet.
• There are three types of directives:
1. page directive
2. include directive
3. taglib directive
• The page directive defines attributes that apply to an entire JSP page.
• Attributes of JSP page directive
The page Directive:
Following is the list of attributes associated with page directive:
buffer Specifies a buffering model for the output stream.
autoFlush Controls the behavior of the servlet output buffer.
contentType Defines the character encoding scheme.
errorPage Defines the URL of another JSP that reports on Java unchecked
isErrorPage Indicates if this JSP page is a URL specified by another JSP page's
extends Specifies a superclass that the generated servlet must extend
import Specifies a list of packages or classes for use in the JSP as the
Java import statement does for Java classes.
info Defines a string that can be accessed with the servlet's
isThreadSafe Defines the threading model for the generated servlet.
language Defines the programming language used in the JSP page.
session Specifies whether or not the JSP page participates in HTTP
isELIgnored Specifies whether or not EL expression within the JSP page will be
isScriptingEnabled Determines if scripting elements are allowed for use.
Jsp Include Directive
• The include directive is used to include the contents of any resource it may
be jsp file, html file or text file. The include directive includes the original
content of the included resource at page translation time
• Advantage of Include directive
• Code Reusability
• Syntax of include directive
• <%@ include file="resourceName" %>
JSP Taglib directive
• The JSP taglib directive is used to define a tag library that defines many
tags. We use the TLD (Tag Library Descriptor) file to define the tags. In the
custom tag section we will use this tag so it will be better to learn it in
• Syntax JSP Taglib directive
• <%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>
Jsp Action Elements
• JSP Action Tags
• There are many JSP action tags or elements. Each JSP action tag is used
to perform some specific tasks.
• The action tags are used to control the flow between pages
If plugin is not working
• The <jsp:param> action is used to provide information in the form of
• This action can be used as direct child element of the following
actions: <jsp:include>, <jsp:forward> and <jsp:params> (which is a child
element of the <jsp:plugin> action).
• The JSP compiler will issue a translation error if this element is used
• The <jsp:param> action has pretty simple and straightforward syntax:
• <jsp:param name="paramName" value="paramValue" />
• Both of the attributes paramName and paramValue are mandatory, and
the paramValue can accept a runtime expression.
• For the <jsp:include> and <jsp:forward> actions, the parameters will be
added to the request object of the included page and forwarded page
JSP Scripting elements,Directives,Action elements,Heart of all web application in java