Learning note _ java web-EL expressions

Source: Internet
Author: User

EL expression
Objects in the access scope (request)
Syntax $ {EL expression}
Common Operators
. Used to access the property user. name
[] Used to access the object property user ["name"]
Used to access data or set users [1]
Used to access objects containing special characters $ {requestScope. ["user. name"]}

Common Operators
() Changing the computing priority
+-/* Arithmetic Operators
= ,! =, <,> Relational operators
&, | Logical operators
? : Conditional operator $ {? B: c}
Empty is used to check whether variables are saved.
At, no equals to null

Values in each function
Request $ {requestScope. news}
Session $ {sessionScope. news}
Applocation $ {applocationScope. news}
Page $ {pagination. news}

Jstl jsp standard tag library can replace java code to a certain extent
Procedure
1. Add jslt. jar and standard. jar to the project.
2. Add commands on the JSP page
<% @ Taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
Tag Library
Resource Identifier prefix
Core label library http://java.sun.com/jsp/jstl/core c
International tag library http://java.sun.com/jsp/jstl/fmt fmt
XML library http://java.sun.com/jsp/jstl/xml x
Database tag library http://java.sun.com/jsp/jstl/ SQL SQL
Function tag library http://java.sun.com/jsp/jstl/functions fn
Common labels
Value = "" displayed value
EscapeXml = "true" escape?
Default = "" default Value
>
Var = "" variable name
Value = "" variable value
Scope = "" scope
>
Var = "" variable name
Scope = "" scope
>
Var = "var" set element name, which calls the object of this loop with $ {var}
Items = "" loop object
VarStatus = ""> cyclic status

Test = "" judgment Condition
Var = "" stores judgment results
Scope = "" var scope
>

Value = "" url to be constructed
>

Name = "" additional parameter name
Value = "" value of the additional parameter
>

Uri = "" reference page url
>

Vlaue = "" time object
Pattern = "" Time Format
>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.