//org.apache.catalina.filters.SetCharacterEncodingFilter /** * Select and set (if specified) the character encoding to be used to * interpret request parameters for this request. * * @param request The servlet request we are processing * @param response The servlet response we are creating * @param chain The filter chain we are processing * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ @Override publicvoiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// Conditionally select and set the character encoding to be used if (ignore || (request.getCharacterEncoding() == null)) { String characterEncoding = selectEncoding(request); if (characterEncoding != null) { request.setCharacterEncoding(characterEncoding); } }
// Pass control on to the next filter chain.doFilter(request, response); }
//org.apache.catalina.core.ApplicationHttpRequest#mergeParameters /** * Merge the parameters from the saved query parameter string (if any), and * the parameters already present on this request (if any), such that the * parameter values from the query string show up first if there are * duplicate parameter names. */ privatevoidmergeParameters(){
if ((queryParamString == null) || (queryParamString.length() < 1)) return;
//org.apache.catalina.core.ApplicationHttpRequest#parseParameters /** * Parses the parameters of this request. * * If parameters are present in both the query string and the request * content, they are merged. */ voidparseParameters(){