Simplify JSP with EL and JSTL

1. Using EL expressions

The full name of EL is Expression Language, which is an expression language that draws on js and XPath. Provides a way to simplify expressions in JSP. It defines a series of implicit objects and operators, thus providing the ability to access and process application data outside of java code. EL expressions are usually used to obtain attribute values ​​in a certain scope (the order is: page, request, session, application), or to do simple operations and judgments.

Syntax: ${expression}

 Both the dot (.) operator and the [] operator can be used, and arithmetic operators, relational operators, logical cloud operators, and Empty operators in java can also be used in expressions. (Write it all in the expression)

 

2. JSTL tags

The full name of JSTL is Java Server Standard Tag Library, which is the JSP standard tag library. It contains a set of standard tags with common functions when developing JSP. These tags provide a way to realize the logic of JSP pages without embedding Java code.

 Tomcat10 is used here, so the imported rack package is different from Tomcat9.

 

 

Guess you like

Origin blog.csdn.net/zouzxxi/article/details/131518561