英文:
Enable absolute ordering in spring using java based configuration instead of xml
问题
我想使用Java代码配置添加/启用absolute-ordering
。以下是我们在web.xml
中使用基于XML的配置:
<absolute-ordering/>
我有一个通过@Configuration
和@EnableWebMvc
进行配置的类,还有另一个实现了WebApplicationInitializer
接口的类。
英文:
I want to add/enable the absolute-ordering
using java code configuration. Below is the xml based configuration we do in web.xml
<absolute-ordering/>
I am having a class that is configured using @Congiguration and @EnableWebMvc and another class that implements WebApplicationInitializer
interface.
答案1
得分: 0
以下是翻译好的内容:
它对我起作用。
显然,您的类路径上有多个 spring-web
或 spring-webmvc
的 JAR 包。或者还有其他贡献该文件的依赖项。
从您的类路径中移除这些源 JAR 包。
文件的名称分别是
spring-web-5.3.0-sources.jar
和
spring-webmvc-5.3.0-sources.jar
我在这个链接上找到了解决方案。
对于基于 XML 的配置,请使用:
在 <display-name>
标签之后,将 <absolute-ordering />
标签添加到您的 web.xml
中。应该可以正常工作。
英文:
It worked for me.
Apparently you have multiple spring-web
or spring-webmvc
jars on your class path.
Or another dependencies that contributes that file as well.
Remove the source jars from your classpath.
Name of the file are
spring-web-5.3.0-sources.jar
and
spring-webmvc-5.3.0-sources.jar
I found the solution at this link
For xml base configuration make use of:
add <absolute-ordering />
tag to your web.xml just under the <display-name> tag. should work fine.
专注分享java语言的经验与见解,让所有开发者获益!
评论