How to split the score on the jsp page

Source: Internet
Author: User

How to split the score on the jsp page

First, use the struts2 label

Split the score using the Split method in the Struts2 tag





-


 

Second, use built-in page Functions

Call functions on the page -- $ {fn:} built-in functions

 

Call such a header file <% @ taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions" %>

The following functions can be called directly.

 

Function Description Example
Fn: contains determine whether the string contains another string
Fn: containsIgnoreCase: determines whether the string contains another string (case-insensitive)
Fn: endsWith determines whether the string ends with another string
Fn: escapeXml converts some characters into XML Representation. For example, <character should be converted to <$ {fn: escapeXml (param: info )}
Position where the fn: indexOf substring appears in the parent string $ {fn: indexOf (name ,"-")}
Fn: join combines the data in the array into a new string and uses the specified character lattice to open $ {fn: join (array ,";")}
Fn: length get the length of the string, Or array size$ {Fn: length (shoppingCart. products )}
Fn: replace Replace$ {Fn: replace (text, "-", "& #149 ;")}
Fn: split the string according to the specified characters $ {fn: split (customerNames ,";")}
Fn: startsWith: determines whether a string starts with a substring.
Fn: substring$ {Fn: substring (zip, 6,-1 )}
Fn: substringAfter get the substring starting from the position of a character $ {fn: substringAfter (zip ,"-")}
Fn: substringBefore: Obtain the substring from the start to the position of a character $ {fn: substringBefore (zip ,"-")}
Fn: Convert toLowerCase to lower case $ {fn. toLowerCase (product. name )}
Fn: Convert toUpperCase to UpperCase characters $ {fn. UpperCase (product. name )}
Fn: trim spaces before and after the trim string $ {fn. trim (name )}

Function Description

Fn: contains (string, substring) if the string parameter contains the substring parameter, truefn: containsIgnoreCase (string, substring) is returned. If the string parameter contains the substring parameter (Case Insensitive), truefn is returned: endsWith (string, suffix) if the string parameter ends with the suffix parameter, truefn: escapeXml (string) is returned to convert the XML (and HTML) with a special meaning to the corresponding XML character entity code, returns fn: indexOf (string, substring) the position where the substring parameter first appears in the string parameter fn: join (array, separator) concatenates a given array with a given separator to form a new word. String and return. Fn: length (item) returns the number of elements contained in the parameter item. The parameter Item type is array, collection, or String. For the String type, the return value is the number of characters in the String. Fn: replace (string, before, after) returns a String object. Replace all places where the before parameter appears in the parameter string with the after string, and return the replaced result fn: split (string, separator) to return an array, take the separator parameter as the delimiter to split the string parameter. Each part after the split is an element of the array fn: startsWith (string, prefix). If the string parameter starts with the prefix parameter, truefn is returned: substring (string, begin, end) returns the string part of the parameter, starting from the begin parameter to the end position of the parameter, including the fn: substringAfter (string, substring) character of the end position) returns the substring fn: substringBefore (string, substring) next to the substring. returns the substring fn: toLowerCase (string) before the substring) convert all characters of the string parameter to lowercase, and convert the returned fn: toUpperCase (string) to uppercase for all characters of the string parameter, and return fn: trim (string) remove the string parameter Spaces at the beginning and endAnd return it

 

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.