I needed some templates to display some code to insert users. I put them in
/project-dir/grails-app/resources/templates/quickInstallCode.html
Then I tried to access them using their relative path ( grails-app/resources/templates/quickInstallCode.html ) and it worked fine.
When we then deployed the application to Tomcat Server using the .war file, the paths began to point to the wrong location.
ERROR call, Template file /var/lib/tomcat6/grails-app/resources/templates/quickInstallCode.html not found.
I suggested that Grails, giving good default settings for everyone, would handle this mess for me, but it seems like it isn't.
I also tried this call, and it seems to work fine, but when deploying the BuildSettingsHolder it does not contain build settings, which led to a fatal error.
BuildSettingsHolder.settings.baseDir.toString()
http://grails.org/doc/latest/api/grails/util/BuildSettingsHolder.html http://grails.org/doc/latest/api/grails/util/BuildSettings.html
I am very upset that I cannot get this easy task to work, but the reason it is so complicated is that all the files are enclosed in WAR and are not decompressed on the server.
So the questions are:
- Where in your project would you put files like this?
- How to get a reliable and stable way to access these files? I just need a stable path to the base directory, without having to hard code something in the configuration ... It can't be that hard.
source share