springmvc文件上传时遇到的问题
1.404。应该是自己的主页或者web路径配置的不对,主页放错文件夹,web.xml路径配置错误
2.500(IDEA项目没有报错,但是浏览器报错500没有类Client),检查环境配置
有可能是部署的war中没有响应的jar包,需要导入
3.403(禁止访问):
jersey跨服务器上报错】com.sun.jersey.api.client.UniformInterfaceException:returned a response status of 403
tomcat默认的情况下是过滤到静态资源的上传的,所以需要我们手动的设置一下!
1.打开你的tomcat的安装的路径,点击conf,找到web.xml打开,然后搜索DefaultServlet
找到这个位置:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
tomcat默认情况下是只读的,如果我们要往里边上传东西,是要将只读改为false的,加上下面的代码就可以了!
<init-param> <param-name>readonly</param-name> <param-value>false</param-value> </init-param>
servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
原文链接:https://blog.csdn.net/jerry11112/article/details/100118042