public class JSTLFunctions extends Object
Constructor and Description |
---|
JSTLFunctions() |
Modifier and Type | Method and Description |
---|---|
static String |
byteFormat(long bytes)
A formatter for formatting byte sizes.
|
static String |
escapeHTMLTags(String string)
This method takes a string which may contain HTML tags (ie, <b>,
<table>, etc) and converts the '<' and '>' characters to
their HTML escape sequences.
|
static String |
replaceAll(String string,
String regex,
String replacement)
JSTL delegate for
String.replaceAll(String, String) . |
static String[] |
split(String string,
String regex)
JSTL delegate for
String.split(String) . |
static String |
urlDecode(String string)
Decodes a
application/x-www-form-urlencoded string using the UTF-8 encoding scheme. |
static String |
urlEncode(String string)
Translates a string into
application/x-www-form-urlencoded format using a specific encoding scheme. |
public static String replaceAll(String string, String regex, String replacement)
String.replaceAll(String, String)
. The first argument is the value on which the
replacement has to occur. The other arguments are passed to String.replaceAll(String, String)
directly.string
- The string to searchregex
- the regular expression to which this string is to be matchedreplacement
- the string to be substituted for each matchString.replaceAll(String, String)
public static String[] split(String string, String regex)
String.split(String)
. The first argument is the value on which the replacement has to
occur. The other argument is used as the argument for the invocation of String.split(String)
.string
- The string to splitregex
- the delimiting regular expressionString.split(String)
public static String byteFormat(long bytes)
bytes
- the number of bytesByteFormat
public static String urlEncode(String string)
application/x-www-form-urlencoded
format using a specific encoding scheme. This
method uses the UTF-8 encoding scheme to obtain the bytes for unsafe characters.string
- the URL to encodeURLEncoder
public static String urlDecode(String string)
application/x-www-form-urlencoded
string using the UTF-8 encoding scheme. The encoding is used
to determine what characters are represented by any consecutive sequences of the form "%xy
".string
- the String to encodeURLDecoder
public static String escapeHTMLTags(String string)
string
- the String to escapeStringUtils.escapeHTMLTags(String)
Copyright © 2003–2020 Ignite Realtime. All rights reserved.