runwar: ability to configure web context with web.xml
DominicWatson opened this issue · 3 comments
I've just been introduced to CommandBox and wanted to start running a server to run our application. However, we rely on tuckey rewrite and would like to have that working with the runwar.jar that you've made here.
I think for ultimate flexibility, we'd like the additional option to be able to specify a web.xml with which to configure the web context. So something like:
java -Drailo.web.config.dir="/some/dir" -javaagent:"/path/to/railo-inst.jar" -jar runwar.jar -war "/my/webroot" -web="/WEB-INF/web.xml" .. etc.
I had a go playing with the source and building runwar but don't really know what I'm doing and couldn't get a build going. I suspect that, after adding the command line option and setting a private variable to store it, you'd want to do something like:
if (webXmlPath != null) {
context.setDescriptor( webXmlPath );
}
Anyways, be interested to hear your thoughts on the matter. Regards,
Dominic
Aha, finally figured out how to build just the runwar project using (on windows):
cfdistro>ant\bin\ant.bat -nouserlib -f build.xml runwar.compile
I'll see if I can get the modifications I want working then provide a Pull request with an illustrative example.
I finally split runwar out into it's own project just a bit ago, and it now uses undertow.io instead of jetty-runner, so there are some significant changes. FWIW, both projects should load the web.xml if there is a WEB-INF directory in the -war dir.
Here's the new runwar repo:
https://github.com/cfmlprojects/runwar
Aha! Nice one. Thanks for that, save me some time ;) I was thinking it should be in its own repo - got lost in build scripts for a while. Taking a look now.