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.