Javaserver Pages Syntax Page 4

ADVERTISEMENT

J
S
P
™ (JSP™) S
AVA
ERVER
AG ES
YNTAX version 2.0
Expression
Usage
Description
Syntax
Language
JSP
XML
ELExpression
A
Allows easy access to application
'${' Expression '}'
Same as JSP syntax
data stored in JavaBeans
components.
Examples:
<a:tag value="${x+y}" />
<a:tag value="${first} ${last}"/>
<a:tag>${x+y}</a:tag>
Expression
A
Either a choice, binary or unary
{ ( ChoiceExpression |
Same as JSP syntax
expression, or a value
( Expression BinaryOp Expression) |
( UnaryOp Expression ) |
Value
}
ChoiceExpression
A
If first expression evaluates to
Expression ? Expression : Expression
Same as JSP syntax
true, evaluate the second
expression; otherwise, evaluate
the third expression.
BinaryOp
A
Supported arithmetic, logical,
and | && | or | || | '+' | '-' | * | / | div | % | mod | >
and | && | or | || | '+' | '-' | * | / | div | % | mod | gt
and relational operators.
| gt | < | lt | >= | ge | <= | le | == | eq | != | ne
| lt | ge | le | == | eq | ne
UnaryOp
A
Supported unary operators
{'-'| ! | not | empty}
Same as in JSP syntax
Expresses variables, for example:
{ValuePrefix | (Value ValueSuffix) }
Same as JSP syntax
Value
A
sessionScope.cart.numOfItems
param['mycom.productId']
The prefix of the variable
{Literal | '('Expression')' | ImplicitObject | Java language
Same as JSP syntax
ValuePrefix
A
expression. For a list of implicit
identifier | FuncInvocation}
objects, see the Implicit Objects
for EL Expressions table at the
end of this card.
ValueSuffix
A
The suffix of the variable
{. Identifier | '['Expression']'}
Same as JSP syntax
expression. The . operator is
automatically evaluated into the
equivalent [] operator. More
specifically, expr-a.identifier-b is
equivalent to
expr-a["identifier-b"].

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 9