JSP Tutorials - Herong's Tutorial Examples - Version 4.03, by Dr. Herong Yang
Syntactic Elements of a JSP Page
This section describes syntactic elements of a JSP page: template data, JSP element, Directive element, Action element, Scripting element, Declaration element, Scriptlet element, Expression element.
From a syntactic point of view, a JSP page can be defined as:
JSP page |- Template Data |- JSP Element |- Directive Element |- Action Element |- Scripting Element |- Declaration Element |- Scriptlet Element |- Expression Element
There are two types of data in a JSP page:
There are three types of JSP elements:
Directive Element: A JSP element that provides global information for the conversion phase.
<%@ directive_name attribute=value ... %>
Action Element: A JSP element that provides actions for the execution phase.
<action_name attribute=value ...>action_body</action_name> <action_name attribute=value .../>
Scripting Element: A JSP element that provides embedded Java statements. There are three types of scripting elements:
Declaration Element: A JSP element that provides the embedded Java declaration statements to be inserted into the Servlet class.
<%! Java declaration statements %>
Scriptlet Element: A JSP element that provides the embedded Java statements to be executed as part of the service method of the Servlet class. There are two ways to write a scriptlet element:
<% Java statements %>
Expression Element: A JSP element that provides the embedded Java expressions to be evaluated as part of the service method of the Servlet class. There are two ways to write an express element:
<%= Java expression %>
Last update: 2012.
Table of Contents