原因:资源名称不能为中文。
附:
(1)getParameter方法获取乱码
原因:Http请求传输时将url以ISO-8859-1编码
解决方法:
(1)代码方式:new String(request.getParameter("参数名").getBytes("iso-8859-1"), "utf-8");
(2)pom方式:tomcat插件的配置项(<configuration>里)加上<charset>utf-8</charset>
(2)tomcat7插件虚拟路径映射方法
<!--tomcat插件的<configuration>里加上-->
<staticContextPath>/imgs</staticContextPath>
<staticContextDocbase>D:/idea/main/webapp/imgs</staticContextDocbase>
<!--此时运行会报错:Child name ‘x‘ is not unique,原因是源码的问题,会重复创建两次映射路径-->
<!--解决方法:下别人修改过的jar包,替换源本地仓库的jar包;或找到其他人制作的更高版本tomcat插件-->
<!--
用来替换的jar包:
https://link.csdn.net/?target=https%3A%2F%2Fgithub.com%2Ffzz1wzy%2Ffzz-tools%2Fblob%2Fmaster%2Ftomcat7-maven-plugin-2.2.jar.zip
-->