a simple playground to check the feasibility to embed a jetty and tomcat server inside am executable war
Compile the project with maven
$ mvn clean package
Then launch the application using
$ java -jar ./app/target/app.war
The application is deployed inside a jetty server at the url
http://localhost:8080
The application exposed the following paths:
/ |
show the index.html content |
/hello |
show the content exposed by the HelloServlet class |
This project contains two maven's modules:
- app: will produce the web app and contains the web.xml file and the Launcher that runs the embedded server.
- core: contains only a servlet and a web-fragment.xml.
The original aim it was to define the servlet inside the fragment and let the jetty publish it using the J2EE spec against the web.xml and web-fragments. At the moment the fragment scanner has been disabled (with the metadata-complete="true") to minimize the startup time.