grails - Grails的classpath

标签 grails classpath

我有带有web.xml(src/templates/war/web.xml)的Grails应用程序,我需要在那里导入applicationContext.xml(WEB-INF/applicationContext.xml)。由Grails创建的那些文件,我想使用它们,但是我无法使用classpath:WEB-INF/applicationContext.xml将applicationContext.xml导入到web.xml中。

我需要这样的东西

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:/web-app/WEB-INF/applicationContext.xml</param-value>
</context-param>

在我的web.xml文件中,但是Grails应用程序类路径没有执行此操作。

最佳答案

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>file:web-app/WEB-INF/applicationContext.xml</param-value>
</context-param>

Grails使用这种方法。

关于grails - Grails的classpath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29467024/

相关文章:

java - 无法在 tomcat 中部署 Grails War 文件 - 结果为 404

hibernate - 日期字段的Grails GORM域对象命名约定和持久性后果

select - 如何在Grails 4上使用 'option group'创建一个下拉列表?

hibernate - Grails生成的 hibernate 定义

chalice : Generating PDF from GSP

java - java 1.7 的类路径配置有什么问题?

java - Eclipse 和 Gradle 类路径导致启动缓慢

android - Kotlin IllegalStateException : Resource not found in classpath: kotlin/. kotlin_string_table

Java - Eclipse 上的类路径问题

android - adb 在 Windows 上未被识别为内部或外部命令