## org.apache.taglibs.standard.tag.common.core
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
`static int` `HIGHEST_SPECIAL`
`static char[][]` `specialCharactersRepresentation`

Constructor Summary
`Util()`

Method Summary
`static String` `escapeXml(String buffer)` Performs the following substring replacements (to facilitate output to XML/HTML pages): & -> & < -> < > -> > " -> " ' -> ' See also OutSupport.writeEscapedXml().
`static String` `getContentTypeAttribute(String input, String name)` Get the value associated with a content-type attribute.
`static Enumeration` `getRequestLocales(HttpServletRequest request)` HttpServletRequest.getLocales() returns the server's default locale if the request did not specify a preferred language.
`static int` `getScope(String scope)`
`static int` `getStyle(String style, String errCode)`
`static String` `URLEncode(String s, 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(String scope)

### getStyle

    public static int getStyle(String style,
                               String errCode)
                        throws JspException

  Throws:
    `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(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 © 2007 Mort Bay Consulting. All Rights Reserved.