I would like to deploy a grails war to a sub context path but when I try this the application will not load and an error filterStart so I'm either missing something or grails can't be deployed to a sub-context. Is there any way to load grails in a sub context?
I thought I'd leave an answer here for anyone who comes along since I've been trying to solve this problem myself.
One trick is to set use the hash/pound sign (#) in the .war file name:
api#1.2.war
Which results in the following app context:
http://localhost:8080/api/1.2/
I've tested this in Tomcat 7.
One reason why I wanted this is so that I can automatically ship different versions running side by side with the following grails BuildConfig.groovy:
grails.project.war.file = "target/api#${appVersion}.war"
This works great with Tomcat 7, I'm unsure about other versions.
However, what I would really like to do is set it up so that Tomcat uses the context from my Grails Config.groovy or application.properties files.
Update 1: I'm using Grails 1.3.7.
Update 2: Successfully tested by user miek in Tomcat 6. Thanks miek!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With