Accessing appName property from controller in Grails

It is trivial to access the appName property from within the config.groovy file, and it is a common practice to do so. Here is an example of specifying an external config file based on the name of the grails application:

grails.config.locations = ["file:$userHome/.osaas/$appName.groovy"

I could find no where obvious that described how to access this appName property from a constructor. You would expect the following to work but it does not:


The following does work however



  1. Thanks a lot... :) I have been searching a lot to figure this out!


Post a Comment

Popular posts from this blog

Android: How to change size of vector drawable image

AngularJs: User friendly date display with AngularJs and MomentJs

Nerd Tree: A File Explorer with Mac Vim