`
chainhou
  • 浏览: 172294 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

The display name was defined in multiple fragments with different values includi

阅读更多
在使用Servlet3.0的新特性中关于WebFragment的特性,即将一些功能打包到jar包中,在web-fragment.xml中声明一些Servlet、Filter,如果使用annotation,此处基本不需要什么配置就可以。
将各个功能的jar加到某个Web应用中,该Web应用就具有了jar包中声明的这些功能。

但在使用Eclipse开发的时候,比如新创建了两个Web Fragment Project,并将其加到某个Web应用中,此时部署到Web容器中会产生如下异常信息
The display name was defined in multiple fragments with different values including fragment with name [XXX]


但只添加一个fragment则没有问题。经过仔细查看,原来是因为两个fragment的项目配置文件web-fragment.xml,在Eclipse创建工程的时都自动生成了display这个标签,但每个web-fragment.xml中的东西又都会被统一解析,因此导致display元素定义重复了。

因此,解决该问题,只需要将web-fragment.xml中的display删除即可。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics