Home > Web Front-end > JS Tutorial > body text

How to use commonly used el expressions

一个新手
Release: 2017-09-14 10:30:36
Original
2385 people have browsed it

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false"%>
Copy after login

Generally add this isELIgnored="false" before it can be used${}

##1.Constant

There must be no spaces between $ and {}, and there can be spaces in {}, such as: ${user.username }

Boolean type: ${true}

## Integer type: ${10}

## Floating point type: ${10.5}

String type: ${"username"}

Empty type: ${null} page does not display

## 2. Four arithmetic operations

EL arithmetic operators: +, -, *,/or p, % or mod

EL relational operator: == or eq,! =or ne, or gt, <= or le> =or ge

# # EL logical operators: && or and, || or or,! Or not

## Other operations: ${ A == a ? B : C}

empty (unary operator): Used to determine whether the value is null (empty), return true, otherwise return false.

## ${empty A} ${not empty.A}

ELWhen operating on the variables in the expression, it Use pageContext.findAttribute("") to find variables

Search from the page, request, session, and application domains in sequence

If the value is not found in any of these four fields. Just return null, or you can specify to search for

in a specific field. Format:

${pageScope.param}

##${requestScope.param}

${sessionScope.param}

${applicationScope.param}

The above is the detailed content of How to use commonly used el expressions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template