Grails 3自定义web.xml和weblogic.xml

时间:2015-10-23 15:20:19

标签: tomcat grails gradle weblogic grails-3.0

Grails 2 documentation说这是可能的,但Grails 3文档没有说明任何内容。

如何将自定义web.xml和weblogic.xml添加到Grails 3应用程序之战?

2 个答案:

答案 0 :(得分:1)

Grails 3.x不使用web.xml。自定义必须在Spring中完成。新的servlet和过滤器可以分别注册为Spring bean或ServletRegistrationBean和FilterRegistrationBean。

在Grails中配置Spring Bean的文档: https://grails.github.io/grails-doc/3.0.x/guide/spring.html

http://grails.github.io/grails-doc/latest/guide/single.html#upgradingApps

收集的信息

文章确实提到了,措辞不好,“尽管仍然可以在src / main / webapp / WEB-INF / web.xml中使用”

尝试创建位于 src / main / webapp / WEB-INF / 中的 web.xml 文件,看看这是否解决了您的问题。

在以前版本的grails中,您可以运行:

grails install-templates

这将生成用于构建应用程序的web.xml grails。

答案 1 :(得分:1)

我刚从2015年10月24日Graeme Rocher发表的JavaOne演讲中看到了这一点。看起来web.xml不再受支持了。

Here is the the video,大约一小时进入演示文稿。 (幻灯片可在网站上下载)。以下是演示文稿中的一些截图:

enter image description here

enter image description here