This code under different Windows to display properly, some import database shows a question mark, sometimes it is according to the code, the code is inside the IDE placed UTF8, also at startup class loading
Public class WebInitFilterConfig implements Filter {
@ Override
Public void init (FilterConfig FilterConfig) throws ServletException {
}
@ Override
Public void doFilter (ServletRequest ServletRequest and ServletResponse ServletResponse, FilterChain FilterChain) throws IOException, ServletException {
//System. Out. Println (" public class WebInitFilterConfig implements the Filter ");
It request=servletRequest (it);
HttpServletResponse response=(HttpServletResponse) servletResponse;
request.setCharacterEncoding("UTF-8");
The response. SetCharacterEncoding (" utf-8 ");
FilterChain. DoFilter (request, response);
}
@ Override
Public void destroy () {
}
}