Joke Collection Website - Blessing messages - How to deal with Chinese garbled code in java development?
How to deal with Chinese garbled code in java development?
arg 0 . setcharacterencoding(" utf-8 ");
arg 1 . setcharacterencoding(" utf-8 ");
arg2.doFilter(arg0,arg 1);
Then configure the filter in web.xml
& lt filter & gt
& lt filter name & gtchinesefilter & lt/filter-name >
& ltfilter-class & gt; com . filter . chinesefilter & lt; /filter-class & gt;
& lt/filter & gt;
& lt filter mapping & gt
& lt filter name & gtchinesefilter & lt/filter-name >
& lturl mode & gt/* & lt;; /URL-pattern & gt;
& lt/filter-mapping & gt;
In the above configuration code, ChineseFilter is the name of the newly created filter class, com.filter.ChineseFilter means that my ChineseFilter.java is put in the com.filter package, and/* means that the filter will handle everything in this project.
It's hard to make it clear in a few words.
- Previous article:How to add a mobile phone number friend to WeChat?
- Next article:Huawei children's watch 3 was forced to restore factory settings.
- Related articles
- Online and offline, the operation mode of recruitment information drainage is adopted.
- What's the phone number of your Nokia service center?
- How to cancel the guaranteed consumption of mobile phone number?
- Does the failure of the exam affect the postgraduate entrance examination?
- Ningbo Cixi will adjust the temporary control area of ??Zhouxiang Town from November 27th
- E-mail interview invitation letter
- How does Apple's mobile phone open handwriting?
- Lei Feng's spiritual successor (5)
- How to query historical short messages
- What happened when I received a short message from Guangdong Court Litigation Network for verification?