org.apache.taglibs.standard.tag.common.core
Class Util

java.lang.Object
  extended by org.apache.taglibs.standard.tag.common.core.Util

public class Util
extends java.lang.Object

Utilities in support of tag-handler classes.

Author:
Jan Luehe

Field Summary
static int HIGHEST_SPECIAL
           
static char[][] specialCharactersRepresentation
           
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.String escapeXml(java.lang.String buffer)
          Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> & < -> < > -> > " -> " ' -> ' See also OutSupport.writeEscapedXml().
static java.lang.String getContentTypeAttribute(java.lang.String input, java.lang.String name)
          Get the value associated with a content-type attribute.
static java.util.Enumeration getRequestLocales(javax.servlet.http.HttpServletRequest request)
          HttpServletRequest.getLocales() returns the server's default locale if the request did not specify a preferred language.
static int getScope(java.lang.String scope)
           
static int getStyle(java.lang.String style, java.lang.String errCode)
           
static java.lang.String URLEncode(java.lang.String s, java.lang.String enc)
          URL encodes a string, based on the supplied character encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGHEST_SPECIAL

public static final int HIGHEST_SPECIAL
See Also:
Constant Field Values

specialCharactersRepresentation

public static char[][] specialCharactersRepresentation
Constructor Detail

Util

public Util()
Method Detail

getScope

public static int getScope(java.lang.String scope)

getStyle

public static int getStyle(java.lang.String style,
                           java.lang.String errCode)
                    throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

escapeXml

public static java.lang.String escapeXml(java.lang.String buffer)
Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> & < -> < > -> > " -> " ' -> ' See also OutSupport.writeEscapedXml().


getContentTypeAttribute

public static java.lang.String getContentTypeAttribute(java.lang.String input,
                                                       java.lang.String name)
Get the value associated with a content-type attribute. Syntax defined in RFC 2045, section 5.1.


URLEncode

public static java.lang.String URLEncode(java.lang.String s,
                                         java.lang.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 java.util.Enumeration getRequestLocales(javax.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.



Copyright (c) 1999-2012 Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.