Changing app.servlet.version does not affect web.xml

99封情书 提交于 2019-12-11 02:43:08

问题


Is there an issue to set the app.servlet.version to 3.0 in the application.properties for grails 2.0?

I created a new app, added the line app.servlet.version=3.0 to the application.properties and executed grails war (even tried clean before). However the web.xml still starts with:

<web-app         xmlns="http://java.sun.com/xml/ns/javaee" 
               version="2.5" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Iwould have expected to see 3.0. I also tried this Procedere with 2.4 and it is still 2.5. Is it the wrong place, which I am looking at?


回答1:


It looks like, that you need to change the BuildConfig.groovy as well, in order to achieve servlet version 3.0 in your web.xml. Add the following line into a plain grails project and the web.xml will start with desired version 3.0:

grails.servlet.version = "3.0"


来源:https://stackoverflow.com/questions/8615596/changing-app-servlet-version-does-not-affect-web-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!