Spring学习遇到问题小计

2019-01-07  本文已影响0人  lipy_

提示错误,没有找到类,需要正确的导入包

java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.<init>(Ljava/lang/Class;)

错误信息.png
导入包.png

REST默认情况下,PUT和DELETE请求是无法提交表单数据的。
解决方案:在web.xml中配置Spring提供的过滤器解决。

<filter>
         <filter-name>HttpMethodFilter</filter-name>
         <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>
</filter>
<filter-mapping>
         <filter-name>HttpMethodFilter</filter-name>
         <url-pattern>/*</url-pattern>
</filter-mapping>
        
<!--  将POST请求转化为DELETE或者是PUT
要用_method指定真正的请求参数 -->
<filter>
         <filter-name>HiddenHttpMethodFilter</filter-name>
         <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
         <filter-name>HiddenHttpMethodFilter</filter-name>
         <url-pattern>/*</url-pattern>
</filter-mapping>

web项目中的跨域问题解决方法

ik-analyzer

spring 分module 运行找不到jar中的spring配置文件

严重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is 
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
上一篇 下一篇

猜你喜欢

热点阅读