This is an example where js cannot use el expressions, but the same is true for html. If it is not a jsp file, it cannot be used.
#html cannot use jstl tags.
el expression (when using el expression to directly obtain the value, for example, ${msg}, there is no need to provide the set get method for msg; but when obtaining the attribute value of the object,
For example, user.name, the set get method must be provided for the name attribute) is a jsp-related concept, which is executed on the server. After the server is executed, it is passed to the client browser. js is executed on the client. When executed by the browser, el has been executed before js.
EL, JSTL and other tags are executed on the server and then sent to the client through the network. The browser client will execute the js script after receiving it. In other words, when the el expression takes effect, the js code is all text. When the js takes effect, the el expression is gone. You can view the source code in the browser and you will find the el tag ${} All gone, converted into specific values.
jsp, js, and html are not on the same plane. They cannot be executed at the same time at the same time. They have no intersection. So the word "use" in the title is in double quotes. It is not that js actually uses the el expression, but uses the final converted value of the el expression.
Similarly, "using" java code in js is the same as using el expressions: JSP is first compiled to compile the java code to form a complete page and then sends it to the client. js is only executed on the client side. When js is executed, js can no longer see the java code.
In js and html filesYou cannot directly use el expressions and java codes (the browser cannot recognize el and other tags in jsp: the result returned to the client is JSP The result of file execution, does not contain any JSP syntax). However, el expressions, java code, js scripts, jstl tags, etc. can all be used in jsp files. Therefore, if you want to use the value of el expression or the value of java code in js code, you can use a bridge like jsp file. Achieve their goals!
js is written in a jsp file. Tags that can be used by jsp (el expressions, jstl tags, java codes, etc.) can be "used" by js; if js is written in a separate file, no tags can be "used" ”, all to no avail. However, it is generally not recommended to use messy jsp tags in js.
The above is the detailed content of Can html use jstl tags?. For more information, please follow other related articles on the PHP Chinese website!

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

How to achieve the effect of mouse scrolling event penetration? When we browse the web, we often encounter some special interaction designs. For example, on deepseek official website, �...

The default playback control style of HTML video cannot be modified directly through CSS. 1. Create custom controls using JavaScript. 2. Beautify these controls through CSS. 3. Consider compatibility, user experience and performance, using libraries such as Video.js or Plyr can simplify the process.

Potential problems with using native select on mobile phones When developing mobile applications, we often encounter the need for selecting boxes. Normally, developers...

What are the disadvantages of using native select on your phone? When developing applications on mobile devices, it is very important to choose the right UI components. Many developers...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
