我使用jquery ajax提交以下表单,我在Action类方法中打印值。我正在使用tomcat 7
<form action="PostNow" id="post_now">
<s:textarea name="message" style="width:100%;height:80px"
id="text_message" cssClass="form-control" placeholder="Post now">
</s:textarea>
</form>
行动中
public String insert() {
HttpServletRequest request = ServletActionContext.getRequest();
System.out.println("char en "+request.getCharacterEncoding());
System.out.println("sendor " + message());
}
Web.xml中
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
在Jsp Page
中<%@page contentType="text/html" pageEncoding="UTF-8"%>
在web.xml中
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>
org.apache.catalina.filters.SetCharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
我正在获得输出
char en UTF-8 ?????? ????? ????? ?? ?????? ?? ????
??
是印地文字符
如何解决这个问题?