1. Page prompt information The prompt information of the garbled page is from ApplicationResources_zh.properties Solution: (1) All JSP pages should be used <% @ page language = "java" contenttype = "text / html; charSet = GBK"%> pointing out the current The charset (2) with NotePad is written in Chinese resource files, such as ApplicationResources_xx.properties. Then use the tool native2ascii to convert Chinese characters in the resource file to GBK, the method is under DOS
native2ascii -encoding GBK ApplicationResources_xx.properties ApplicationResources_zh.properties2, Chinese character submitted by the server (JBOSS) garbled solution: add a filter, which will request the Chinese to GBK public void doFilter (ServletRequest request, ServletResponse response, FilterChain chain Throws oException, servletexcerencoding ("gbk"); chain.dofilter (Request, response);} 3, unrelated to Struts, mysql's default character set setting problem Submit Chinese to mySQL database The saved is garbled, displayed as ??????. The default character set of mysql needs to be modified, the method is: add a default-character-set = GB2312 in My.ini