Home > Article > Web Front-end > Can EL expressions be used in HTML5?
EL expressions cannot be used in HTML5; EL expressions are used to replace expression scripts in JSP pages for data output. Therefore, EL expressions are written in jsp pages, not in HTML5 pages. Expressions The expression is generally the key of the domain object, which can make JSP writing easier. The syntax of EL expression is "${expression}".
The operating environment of this article: Windows 10 system, html5 version, Dell G3 computer.
EL expressions cannot be used in HTML5
The full name of EL expression: Expression Language, that is, expression Language
The role of EL expression: instead of the expression script in the JSP page for data output
EL expression is much simpler than the JSP expression script
EL expression The format is: ${expression},
EL (Expression Language) is to make JSP writing easier. Expression language is inspired by ECMAScript and XPath expression language. It provides methods to simplify expressions in JSP, making JSP code more simplified.
Note: EL expressions are written in the jsp page, and the expression is generally the key of the domain object
Code demonstration: Create Test.jsp## in the web directory #
<body> <% request.setAttribute("key", "value"); %> <%-- 表达式脚本输出key1的值 --%> <%=request.getAttribute("key1")%> <%-- EL表达式输出key1的值 --%> ${key1} <%-- 表达式脚本输出null值时页面显示null EL表达式输出null值时页面什么都不显示(空串)--%> </body>Run results: Recommended tutorial: "
html video tutorial"
The above is the detailed content of Can EL expressions be used in HTML5?. For more information, please follow other related articles on the PHP Chinese website!