/** * Return the Locale to character set mapper for this Context. */ @Override public CharsetMapper getCharsetMapper() { // Create a mapper the first time it is requested if (this.charsetMapper == null) { try { Class<?> clazz = Class.forName(charsetMapperClass); this.charsetMapper = (CharsetMapper) clazz.newInstance(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); this.charsetMapper = new CharsetMapper(); } } return (this.charsetMapper); }
/** * Return the Locale to character set mapper for this Context. */ public CharsetMapper getCharsetMapper() { // Create a mapper the first time it is requested if (this.charsetMapper == null) { try { Class clazz = Class.forName(charsetMapperClass); this.charsetMapper = (CharsetMapper) clazz.newInstance(); } catch (Throwable t) { this.charsetMapper = new CharsetMapper(); } } return (this.charsetMapper); }
/** * Set the Locale that is appropriate for this response, including * setting the appropriate character encoding. * * @param locale The new locale */ public void setLocale(Locale locale) { if (isCommitted()) return; if (included) return; // Ignore any call from an included servlet this.locale = locale; if (this.context != null) { CharsetMapper mapper = context.getCharsetMapper(); this.encoding = mapper.getCharset(locale); if (contentType != null) { if (contentType.indexOf(';') < 0) { contentType = contentType + ";charset=" + encoding; } else { // Replace the previous charset int i = contentType.indexOf(';'); contentType = contentType.substring(0, i) + ";charset=" + encoding; } } } }
/** * Return the Locale to character set mapper for this Context. */ @Override public CharsetMapper getCharsetMapper() { // Create a mapper the first time it is requested if (this.charsetMapper == null) { try { //CharsetMapper Class<?> clazz = Class.forName(charsetMapperClass); this.charsetMapper = (CharsetMapper) clazz.newInstance(); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); this.charsetMapper = new CharsetMapper(); } } return (this.charsetMapper); }
/** * Set the Locale to character set mapper for this Context. * * @param mapper The new mapper */ @Override public void setCharsetMapper(CharsetMapper mapper) { CharsetMapper oldCharsetMapper = this.charsetMapper; this.charsetMapper = mapper; if( mapper != null ) this.charsetMapperClass= mapper.getClass().getName(); support.firePropertyChange("charsetMapper", oldCharsetMapper, this.charsetMapper); }
/** * Set the Locale that is appropriate for this response, including * setting the appropriate character encoding. * * @param locale The new locale */ 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; } CharsetMapper cm = getContext().getCharsetMapper(); String charset = cm.getCharset( locale ); if ( charset != null ){ coyoteResponse.setCharacterEncoding(charset); } }
/** * Set the Locale to character set mapper for this Context. * * @param mapper The new mapper */ public void setCharsetMapper(CharsetMapper mapper) { CharsetMapper oldCharsetMapper = this.charsetMapper; this.charsetMapper = mapper; if( mapper != null ) this.charsetMapperClass= mapper.getClass().getName(); support.firePropertyChange("charsetMapper", oldCharsetMapper, this.charsetMapper); }
/** * Set the Locale to character set mapper for this Context. * * @param mapper The new mapper */ public void setCharsetMapper(CharsetMapper mapper) { CharsetMapper oldCharsetMapper = this.charsetMapper; this.charsetMapper = mapper; support.firePropertyChange("charsetMapper", oldCharsetMapper, this.charsetMapper); }
/** * Set the Locale to character set mapper for this Context. * * @param mapper * The new mapper */ @Override public void setCharsetMapper(CharsetMapper mapper) { CharsetMapper oldCharsetMapper = this.charsetMapper; this.charsetMapper = mapper; if (mapper != null) this.charsetMapperClass = mapper.getClass().getName(); support.firePropertyChange("charsetMapper", oldCharsetMapper, this.charsetMapper); }
/** * 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; } CharsetMapper cm = getContext().getCharsetMapper(); String charset = cm.getCharset( locale ); if ( charset != null ){ coyoteResponse.setCharacterEncoding(charset); } }
@Deprecated @Override public CharsetMapper getCharsetMapper() { return null; }
@Deprecated @Override public void setCharsetMapper(CharsetMapper mapper) { /* NO-OP */ }
@Override @Deprecated public CharsetMapper getCharsetMapper() { return null; }
@Override @Deprecated public void setCharsetMapper(CharsetMapper mapper) { // NO-OP }
@Override public CharsetMapper getCharsetMapper() { return null; }