Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSP中的UTF-8编码&;雄猫_Jsp_Http_Tomcat_Encoding_Utf 8 - Fatal编程技术网

JSP中的UTF-8编码&;雄猫

JSP中的UTF-8编码&;雄猫,jsp,http,tomcat,encoding,utf-8,Jsp,Http,Tomcat,Encoding,Utf 8,我正在使用运行在Tomcat7.0.50上的基于jsp的应用程序 jsp保存在utf-8中,每个jsp都具有 <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> 但当我试图

我正在使用运行在Tomcat7.0.50上的基于jsp的应用程序

jsp保存在utf-8中,每个jsp都具有

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />
但当我试图从表单中检查http post中传递的参数时,我发现“Français”被传递为“Français”

如何解决这个问题并强制http post编码为utf-8?
我正在进行的配置有什么问题?

我找到了解决此问题的方法,在处理请求参数之前,只需插入:

request.setCharacterEncoding("UTF-8");
一切都会好起来的

set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8
request.setCharacterEncoding("UTF-8");