Пример #1
0
  /**
   * Set the Locale that is appropriate for this response, including setting the appropriate
   * character encoding.
   *
   * @param locale The new locale
   */
  @Override
  public void setLocale(Locale locale) {

    if (isCommitted()) {
      return;
    }

    // Ignore any call from an included servlet
    if (included) {
      return;
    }

    coyoteResponse.setLocale(locale);

    // Ignore any call made after the getWriter has been invoked.
    // The default should be used
    if (usingWriter) {
      return;
    }

    if (isCharacterEncodingSet) {
      return;
    }

    String charset = getContext().getCharset(locale);
    if (charset != null) {
      coyoteResponse.setCharacterEncoding(charset);
    }
  }