Closed plusplus closed 13 years ago
This isn't documented (yet), but you can do this by adding some parameters to your WAR's web.xml
. Adding an init parameter called app-script-filename
will cause the RatpackServlet
to load your app from a Groovy script in your WEB-INF/lib
folder. Here's a quick example:
<servlet>
<servlet-name>Ratpack</servlet-name>
<servlet-class>com.bleedingwolf.ratpack.RatpackServlet</servlet-class>
<init-param>
<param-name>app-script-filename</param-name>
<param-value>yourApp.groovy</param-value>
</init-param>
</servlet>
Assuming the file WEB-INF/lib/yourApp.groovy
exists and is a valid Ratpack app, this will create a servlet you can route requests to and have them handled by your app.
Thanks for feedback! Unfortunately the powers that be have forced the app I'm working on to be a Grails app. Thanks for the good work :)
Hi - how would you go about building a WAR file for a ratpack app to drop into a servlet container? Apologies if this is newb - I'm more familiar with sinatra than groovy.