Grails更改了web-app静态目录

时间:2013-12-31 19:27:59

标签: grails

我正在通过grails 2.2.4运行应用程序。目前,grails处理来自“web-app /”目录库的所有请求。不幸的是,我的网络应用程序中的所有URI引用都是“app / images”,“app / styles”,“app / scripts”等类型。这意味着对“/ images”的任何调用都会触及“web- app / images“,而不是真正的”web-app / app / images“。是否有一种简单的方法可以在所有呼叫前面添加额外的“/ app /”前缀?

文件结构:

  /web-app
    /app
      /images
      /styles
      /scripts

1 个答案:

答案 0 :(得分:2)

如果您使用的是资源插件(我认为您会这样做),请查看configuration部分。

您需要Config.groovy中的以下设置:

grails.resources.work.dir = '/app/'

//if a prefix is required other than 'static'
grails.resources.uri.prefix = '/content/' 
相关问题