Literals Errors, Warnings, Default Values Operators Operator Precedence

WebLogic JSP Reference 13-13 Relational comparisons are allowed using the standard Java relational operators. Comparisons may be made against other values, or against boolean for equality comparisons only, String, integer, or floating point literals. Arithmetic operators can be used to compute integer and floating point values. Logical operators are available.

13.12.1 Literals

Literals exist for boolean, integer, floating point, string, null. ■ Boolean - true and false ■ Integer - As defined by the IntegerLiteral construct in section 1.19, Collected Syntax, of the JSP 2.1 EL specification. ■ Floating point - As defined by the FloatingPointLiteral construct in section 1.19, Collected Syntax, of the JSP 2.1 EL specification. ■ String -With single and double quotes - is escaped as \, is escaped as \, and \ is escaped as \\. Quotes only need to be escaped in a string value enclosed in the same type of quote. ■ Null - null

13.12.2 Errors, Warnings, Default Values

JSP pages are mostly used in presentation, and in that usage, experience suggests that it is most important to be able to provide as good a presentation as possible, even when there are simple errors in the page. To meet this requirement, the JSP EL does not provide warnings, just default values and errors. Default values are typecorrect values that are assigned to a subexpression when there is some problem. An error is an exception thrown to be handled by the standard JSP machinery.

13.12.3 Operators

The following is a list of operators provided by the JSP expression language: ■ . and [] ■ Arithmetic: +, - binary, , and div, and mod, - unary ■ Logical: and, , or, ||, not, ■ Relational: ==, eq, =, ne, , lt, , gt, =, ge, =, le. Comparisons can be made against other values, or against boolean, string, integer, or floating point literals. ■ Empty: The empty operator is a prefix operation that can be used to determine whether a value is null or empty. ■ Conditional: A ? B : C. Evaluate B or C, depending on the result of the evaluation of A. For more information about the operators and their functions, see the JSP 2.1 specification.

13.12.4 Operator Precedence

The following is operator precedence, from highest to lowest, left-to-right. ■ [] . ■ ■ - unary not empty 13-14 Developing Web Applications, Servlets, and JSPs for Oracle WebLogic Server ■ div mod ■ + - binary ■ = = lt gt le ge ■ == = eq ne ■ and ■ || or ■ ? :

13.13 JSP Expression Language Reserved Words