Javaserver Pages Syntax

ADVERTISEMENT

J
S
P
™ (JSP™) S
AVA
ERVER
AG ES
YNTAX version 2.0
Usage
Description
Syntax
JSP
XML
Legend
All tags are case sensitive. A pair of single quotes is equivalent to a pair of double quotes. Spaces are not allowed between an
equals sign and an attribute value.
plain text = required bold = default
italics = user-defined | = or
' ' = literal
^ = anything other than
[ ] = optional
{ } = required choice ... = list of items
+ = can repeat ( ) = grouped together - = a range
Notes
Some action elements have attributes whose value can be computed at request time. In JSP syntax, the format of such a
value is the same as a JSP expression: <%= expression %>. In XML syntax, the format of the value is %= expression %. When
using the JSP expression language (EL), the format of the value in either syntax is ${ expression }.
EL expressions can be quoted by adding a backslash to the front of the expression when the expression language is
enabled. This prevents the expression from being evaluated. Example: \${x+y} will display as ${x+y}.
All elements in XML syntax can contain an xmlns attribute that complies with the XML namespaces spec. This attribute is
used to declare tag libraries and other namespaces. Within the start tag of an element, its syntax is
[xmlns:taglibprefix="URI"]+
All JSP standard actions and custom actions can contain a jsp:attribute standard element as a substitue for any of its
attributes. The jsp:attribute syntax is <jsp:attribute name=attributeName [ trim= "true | false" ] />
If an action contains any jsp:attribute elements and the action also has a body, it must use the jsp:body tag to represent the
body. The jsp:body syntax is <jsp:body> any elements or text </jsp:body>
The Usage column indicates where the element can be used. S = JSP pages. X= JSP documents. TS= tag files in standard
syntax. TX= tag files in XML syntax. A = All.
Documents the JSP file, but is
<%-- comment --%>
<!-- comment -->
Comment
A
not included in the response.
The comment can include
anything except --%> (or --> if
the comment is in XML syntax).
Declaration
A
Declares variables or methods
<%! declaration; [ declaration; ]+ ... %>
<jsp:declaration>
valid in the page’s scripting
code fragment
[
declaration
; ]
+ ...
language.
</jsp:declaration>
EL Expression
A
Contains an expression in the
${ Expression }
same as JSP syntax
JSP Expression Language (EL).
See Expression Language section
below for the syntax.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 9