Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning
titleNew CAS documentation site

CAS documentation has moved over to jasig.github.io/cas, starting with CAS version 4.x. The wiki will no longer be maintained. For the most recent version of the documentation, please refer to the aforementioned link.

Excerpt

There are a number of considerations for deploying CAS in a locale other than en-US, some of which are discussed here.

Localization

The Localization page describes how to switch from the default en-US locale to any of a number of supported locales, as well as instructions for adding support for a locale not provided out of the box.

...

Supporting character sets other than ASCII will be a primary concern for many international deployments. The following steps are required to support end-to-end UTF-8 character set encoding in CAS.

  1. Ensure pageEncoding of all JSP views is UTF-8. (This is the default for most if not all views packaged with CAS)

    Code Block
    
    <%@ page pageEncoding="UTF-8" %>
  2. Ensure the Content-Type header specifies UTF-8 encoding:

    Code Block
    
    <%@ page contentType="text/html; charset=UTF-8" %>
    ...
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      ...
    </head>
    ...
  3. Set the character set encoding to UTF-8 for both the request and response as early in the processing stage as possible. The most convenient solution for this is defining a servlet filter that sets HttpServletRequest#setCharacterEncoding() and HttpServletResponse#setCharacterEncoding() to UTF-8. The following example uses CharacterEncodingFilter, which is a convenient choice that is actively maintained and well-documented. Code Block <!-- This filter should be placed at the head of the filter chain, if possible, to ensure that all downstream filters have the proper encoding. --> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>edu.vt.middleware.servlet.filter.CharacterEncodingFilter</filter-class> <!-- Sets the character encoding of the request to the given Java character set name. Name must be understood by java.nio.charset.Charset class, e.g., ISO-8859-1, UTF-8, UTF-16. --> <init-param> <param-name>requestCharsetName</param-name> <param-value>UTF-8</param-value> </init-param> <!-- Sets the character encoding of the response to the given Java character set name. Name must be understood by java.nio.charset.Charset class, e.g., ISO-8859-1, UTF-8, UTF-16. --> <init-param> <param-name>responseCharsetName</param-name> <param-value>UTF-8</param-value> </init-param> </filter> Recent versions of CAS provide this functionality by default using CharacterEncodingFilter.