Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.
JSP tags
Jstl:java self-developed a set of tag library, for you to use in the JSP page, you can simplify and beautify the JSP page code, it also has loops, judgments, ternary and other statements, and El expression mixed. Generally we use the Jstl and El expressions to see the Java code on the JSP page.
To use the JSTL tag library, you first need to check the packages that Maven relies on for Jstl:
If you have no JSTL package, you should introduce yourself:
First go to the MAVEN Central Library to bring in the jstl dependency;
Introduction failed, then I put the downloaded package into the Lib under Web-inf, and then Addtobuild,
Then, if you want to use the JSTL tag library in a JSP page, first use the taglib command to bring in the JSTL tag library:
Jstl Tag Library Learning:
1. Expression tokens: Out, set, remove, catch
2. Process tagging: if (no else, single), choose (Multipath-when, otherwise)
3. Loop markers: ForEach, Fortokens
Set tag:
You can also assign a value to an attribute in an object:
If you use the EL expression directly to output, there is no way to filter out the HTML code:
It can be filtered using out, which filters the HTML code into entities:
Of course, the above is the output of the filtering effect, if you do not want to filter, you can use EscapeXML to set false filter:
You can also output default values for some properties that are not available (the same effect can be achieved with ternary):
This remove is a value that can be used to delete the stored property.
Catch can be used to catch information about an exception, and then you can print out the exception error message later.
One-way condition if judged as.
There are multiple conditions to judge:
Multi-path condition judgment, in the meantime can use if statement to do condition judgment.
Use Jstl and El Expressions to change index.jsp pages:
javaee--jsp Label