ECM Chinese garbled characters

Source: Internet
Author: User

You cannot enter Chinese characters when running ECM. For example, Chinese names of new users are displayed as garbled characters. After reading the forum, I found a suitable solution, that is, configuring an encodingfilter filter for processing Chinese encoding.

Encodingfilter. Java:

Import javax. servlet .*;
Import javax. servlet. http .*;
Import java. Io. ioexception;
Public class encodingfilter implements filter {
Private filterconfig Config = NULL;

Public void dofilter (servletrequest request, response, filterchain chain) throws ioexception, else {
If (request instanceof httpservletrequest) {
httpservletrequest httpreq = (httpservletrequest) request;
try {
request. setcharacterencoding ("UTF-8");
}catch (exception e) {
config. getservletcontext (). log ("error setting utf8 encoding:" + E. getmessage ();
}< BR >}

// Perform any other filters that are chained after this one.
// This includes des calling the requested servlet!
Chain. dofilter (request, response );
}
Public void destroy (){
}

Public void Init (filterconfig ){
This. Config = filterconfig;
}

}

Configure this filter in exo-Tomcat/CONF/Web. xml:

<Filter>
<Filter-Name> encodingfilter </filter-Name>
<Filter-class> encodingfilter </filter-class>
</Filter>

<Filter-mapping>
<Filter-Name> encodingfilter </filter-Name>
<URL-pattern>/* </url-pattern>
</Filter-mapping>

after configuration, the Chinese characters submitted in the form are displayed correctly. However, in the ECM Portlet, the Chinese directory or file name still has a problem. Either an error is displayed or the file cannot be opened. no solution has been found yet.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.