(Quick Reference)

3.1.1 内置选项 - Reference Documentation

Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith

Version: null

3.1.1 内置选项

Grails also provides the following configuration options:
  • grails.config.locations - The location of properties files or addition Grails Config files that should be merged with main configuration
  • grails.enable.native2ascii - Set this to false if you do not require native2ascii conversion of Grails i18n properties files
  • grails.views.default.codec - Sets the default encoding regime for GSPs - can be one of 'none', 'html', or 'base64' (default: 'none'). To reduce risk of XSS attacks, set this to 'html'.
  • grails.views.gsp.encoding - The file encoding used for GSP source files (default is 'utf-8')
  • grails.mime.file.extensions - Whether to use the file extension to dictate the mime type in Content Negotiation
  • grails.mime.types - A map of supported mime types used for Content Negotiation
  • grails.serverURL - A string specifying the server URL portion of absolute links, including server name e.g. grails.serverURL="http://my.yourportal.com". See createLink.

Grails同样提供了如下配置选项:

  • grails.config.locations - 配置文件的位置,包括属性文件或者其他需要合并到主配置的Grails配置文件
  • grails.enable.native2ascii - 如果不需要native2ascii来转化Grails i18n属性文件的话,将该选项设为false
  • grails.views.default.codec - 设置GSP的默认编码制式,可以是:'none', 'html', 或者 'base64' (缺省为'none'). 为了减少XSS攻击的风险,建议设置成'html'.
  • grails.views.gsp.encoding - GSP源文件的字符编码(缺省是'utf-8')
  • grails.mime.file.extensions - 是否使用文件的扩展名表示内容协商中的媒体类型(mime type)
  • grails.mime.types - 内容协商所支持的媒体类型
  • grails.serverURL - 一个指向服务器URL的绝对地址,包括服务器名称,比如grails.serverURL="http://my.yourportal.com". 详细请看createLink

War generation

  • grails.project.war.file - Sets the name and location of the WAR file generated by the war command
  • grails.war.dependencies - A closure containing Ant builder syntax or a list of JAR filenames. Lets you customise what libaries are included in the WAR file.
  • grails.war.copyToWebApp - A closure containing Ant builder syntax that is legal inside an Ant copy, for example "fileset()". Lets you control what gets included in the WAR file from the "web-app" directory.
  • grails.war.resources - A closure containing Ant builder syntax. Allows the application to do any other other work before building the final WAR file

For more information on using these options, see the section on deployment

War生成选项

  • grails.project.war.file - 设置 war 命令生成WAR文件的名称和位置
  • grails.war.dependencies - 符合Ant生成器语法的闭包或者JAR文件的列表,让你可以定制WAR文件所需要的依赖库。
  • grails.war.copyToWebApp - 完成Ant拷贝且满足其生成器语法的闭包,比如"fileset()"。让你控制"web-app"目录下那些资源可以被打包到WAR文件中。
  • grails.war.resources - 符合Ant生成器语法的闭包,运行应用在构建最终的WAR文件前做任何其他的预处理

这些选项的更多信息,请参考 部署 章节。