Search code examples
javawarpom.xmldukescript

Package DukeScript client artifacts in a war and serve from a web container (such as Tomcat)


I've followed the instructions here to create the sample DukeScript "Words" app. Everything works fine. I'd now like to serve the application using a web container. Is there an example of how to package the whole thing so that it can be deployed in a web container such as Tomcat.

Ideally - what I would also like to be able to do is make code changes, deploy to Tomcat, start tomcat, fire up my browser and visit the app. i.e. follow the normal Java webapp development cycle.

Is this possible?


Solution

  • In this scenario Tomcat wouldn't do anything but serve static content. The words application is pure static client code (no servlets, nothing...). So you can use a simple browser to access the index.html on disk. If you insist on using tomcat for development: There's no need to redeploy. The only thing you need to do is configure tomcat to serve the static content that the build generates. If you named your application "helloworld" this would be:

    /helloworld/client-web/target/helloworld-web-1.0-SNAPSHOT-bck2brwsr/public_html

    Make your code changes, build, reload the page in browser and the browser will see the updates