Class Util
- java.lang.Object
-
- org.apache.taglibs.standard.tag.common.core.Util
-
public class Util extends Object
Utilities in support of tag-handler classes.
- Author:
- Jan Luehe
-
-
Field Summary
Fields Modifier and Type Field Description static intHIGHEST_SPECIALstatic char[][]specialCharactersRepresentation
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringescapeXml(String buffer)Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> & < -> < > -> > " -> " ' -> ' See also OutSupport.writeEscapedXml().static StringgetContentTypeAttribute(String input, String name)Get the value associated with a content-type attribute.static EnumerationgetRequestLocales(jakarta.servlet.http.HttpServletRequest request)HttpServletRequest.getLocales() returns the server's default locale if the request did not specify a preferred language.static intgetScope(String scope)static intgetStyle(String style, String errCode)static StringURLEncode(String s, String enc)URL encodes a string, based on the supplied character encoding.
-
-
-
Field Detail
-
HIGHEST_SPECIAL
public static final int HIGHEST_SPECIAL
- See Also:
- Constant Field Values
-
specialCharactersRepresentation
public static char[][] specialCharactersRepresentation
-
-
Method Detail
-
getScope
public static int getScope(String scope)
-
getStyle
public static int getStyle(String style, String errCode) throws jakarta.servlet.jsp.JspException
- Throws:
jakarta.servlet.jsp.JspException
-
escapeXml
public static String escapeXml(String buffer)
Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> & < -> < > -> > " -> " ' -> ' See also OutSupport.writeEscapedXml().
-
getContentTypeAttribute
public static String getContentTypeAttribute(String input, String name)
Get the value associated with a content-type attribute. Syntax defined in RFC 2045, section 5.1.
-
URLEncode
public static String URLEncode(String s, String enc)
URL encodes a string, based on the supplied character encoding. This performs the same function as java.next.URLEncode.encode in J2SDK1.4, and should be removed if the only platform supported is 1.4 or higher.- Parameters:
s- The String to be URL encoded.enc- The character encoding- Returns:
- The URL encoded String [taken from jakarta-tomcat-jasper/jasper2 org.apache.jasper.runtime.JspRuntimeLibrary.java]
-
getRequestLocales
public static Enumeration getRequestLocales(jakarta.servlet.http.HttpServletRequest request)
HttpServletRequest.getLocales() returns the server's default locale if the request did not specify a preferred language. We do not want this behavior, because it prevents us from using the fallback locale. We therefore need to return an empty Enumeration if no preferred locale has been specified. This way, the logic for the fallback locale will be able to kick in.
-
-