JSTL parsing -- 002 -- core tag library 01

Source: Internet
Author: User
Tags tld
For versions earlier than javaEE5, You need to reference JSTL-related jar packages and tld files. After JAEE5, you don't have to worry about this. If you still cannot use it, download it from the official website (jstljar and standardjar) these two jar packages put the corresponding tld file under the root directory of the project. For versions earlier than javaEE5, the core must reference the jar packages and tld files related to JSTL, after JAEE5, you don't have to worry about it. If you still cannot use it, you can download it from the official website (jstl. jar and standard. jar) The two jar packages put the corresponding tld file under the root directory of the project. The core tag library is the core tag library of JSTL, or the basic tag library, the most basic functions are implemented. Here is one by one: 1, When you see the "out" tag, you should be able to guess what the output means. The "out" tag is used to output data. Here is a simple example to try the "out" tag [html] view plaincopyprint? The action parameter is: Isn't it easy? First, let me explain: out is the Tag Name and value is its attribute. Do some new users not know $ {param. action? This is an EL expression. If you are interested, I will explain it separately later. The actual effect of this expression is the same as that of request. getParameter ("action. In fact, the out Tag also has the default and escapeXml attributes, Where default is the default value, if the default value is output without the value attribute, if excapeXml is true (excapeXml is true by default ), the output content will be encoded in xml format (note that only special characters such as "&", "<", and ">" will be encoded). Is it a bit dizzy for some students? For example: "} '/> Do you know what the output is? Yes <,>, and $ {"<>"} directly outputs <>. This is a magical place. It seems useless. You can go to the computer and knock on the code to know it. 2, The tag is a condition judgment tag in JSTL, which is equivalent to the if condition judgment in java. Your Content When the value obtained by param. action is ceshi, the content in the output will be noted. The condition is false. The condition is true. For this reason, you can study why? If else exists in java, you may ask What about labels? The answer is no. What should I do if I want to implement this function? Solutions are still available , And How to solve the problem: When tag output Otherwise output Is it really tough? If you are interested, please wait for further explanation.
Related Article

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.