el/jstl-jsp page more simple output mode

Source: Internet
Author: User

1.EL (expression Language): Expression language for page output

Format: ${expression}

El supports arithmetic, relational operations "common EQ to compare strings or judge equality", logical operations

El accesses objects in space, [Class. Object]

2.JSTL Core Tag Library: simplifies labeling of JSP page designs

1. Download the jar pack    Jstl.jar and Standard.jar into the Lib directory
2. JSP introduces <% @taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%> URI: Uniform Resource identifiers (including URLs)

3. Basic tags include var for use variables and scope scope
<c:out>
<c:out value= "${}"/>
<c:set> Set JSP space values, or container values
Example: <c:set var= "name" value= "" scope= "Session"/>
<c:remove>
  4. Condition label
<c:if>
Example: <c:if test= "${1>0} var=" R "scope=" page "> page display </c:if>
<c:choose>,<c:when>,<c:otherwise>
Equivalent to the IF/ELSE structure, the page display content is placed between the start and end tags to

5. Iteration Labels
<c:foreach> "Popular"
<c:foreach var= "s" items= "${an array or set of iterations}"  varststus= "status" >    ${status.count}    ${str} </c:foreach>

Where items are iterated arrays or collections, Varstatus is the variable name of the iteration state object "where the iteration value is stored"       

 

  

  

el/jstl-jsp page more simple output mode

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.