Jstl Common label collation <c:out><c:fortoken>, basic expression Ne,el

Source: Internet
Author: User
Tags arithmetic operators

<c:url value= "http://baidu.com" var= "url" scope= "session"/>

The <c:url> tag has the following properties:

Attribute Description Required Default
Value Root URL Yes None
Context /Name of the local Web application after No Current application
Var The name of the variable, the URL of the exposed handle No Print to Page
Scope The scope of the variable exposes the processed URL No Page

<c:forTokens>

Example 1:

<c:fortokens items= "Zara,nuha,roshy" delims= "," var= "name" >
<c:out value= "${name}"/><p>
</c:forTokens>

Example 2:

  1. <c:fortokens var="str" items="${sourcestr}" delims= "|," varstatus="status" >

  2. <c:out value="${status.count}" />//the iteration count of the current iteration starting at 1

  3. <c:out value="${status.index}" />//the iteration index of the current iteration starting at 0

  4. <c:if test="${status.last}">//is used to indicate whether the current iteration is the last iteration

  5. <br> Total is divided into <c:out value="${status.count}" /> segment.

  6. </c:if>

  7. <c:out value="${status.index}" />//the iteration index of the current iteration starting at 0

  8. </c:forTokens>

C:fortokens Property Description Table
650) this.width=650; "Src=" http://dl.iteye.com/upload/attachment/141597/1de1b27c-2f2a-3b39-8c80-b7929663a8ac.bmp "alt=" 1de1b27c-2f2a-3b39-8c80-b7929663a8ac.bmp "/>

Reference

Varstatus, which describe the current state of the iteration, the meanings of these properties are as follows:

Current: The item (in the collection) for this iteration.

Index: The current iteration of this iteration, starting at 0.

Count: The iteration count that is currently starting at 1 for this iteration.

First: Used to indicate whether the current iteration is the initial iteration, which is a Boolean type.

Last: Used to indicate whether the current iteration is the final iteration, which is a Boolean type.

The value of the Begin:begin property.

The value of the End:end property

The value of the Step:step property

Expressions for Jstl

Table 1. El Implicit Object

Category Identifier Describe
Jsp pageContext PageContextinstance corresponds to the processing of the current page
Scope pageScope Class associated with the name and value of the page scope property Map
requestScope Class associated with the name and value of the request scope property Map
sessionScope Class associated with the name and value of a session-scoped property Map
applicationScope Class associated with the name and value of the application scope property Map
Request parameters param Class that stores the primary value of a request parameter by name Map
paramValues Class that stores all the values of a request parameter as String an array Map
Request Header header class for storing request header primary values by name Map
headerValues class to store all the values of the request header as String an array Map
Cookies cookie class to store the cookie that is included with the request by name Map
Initialize parameters initParam Classes that store Web application context initialization parameters by name Map

Table 2. El operator

Category Operator
Arithmetic operators +, - , * , / (or div ) and % /or mod
Relational operators ==(or eq ), != (or), (or), (or), (or) ne < lt > gt <= le and >= / ge or
logical operators &&(or) and , || (or or ) and ! /or not
Validation operators empty

Table 3. El operator Precedence (top-to-bottom, left-to-right)

[],.
()
Unary,,, - not !empty
*,,, / div % ,mod
+, binary-
(),,,,,, <</code> > <= >= lt gt le ,ge
==, != , eq ,ne
&&and
||or


This article is from the "Sign Up" blog, so be sure to keep this source http://6203973.blog.51cto.com/6193973/1616891

Jstl Common label collation <c:out><c:fortoken>, basic expression Ne,el

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.