How do you specify the root context in your tags in web.xml?

This can’t be done in an appserver agnostic way. Context root isn’t part of the standard web.xml file. It’s either specified when you deploy the app or in an appserver specific descriptor. Glassfish: sun-web.xml; JBoss: jboss-web.xml; Weblogic: weblogic.xml; Tomcat: context.xml; WebSphere: ibm-web-ext.xml. Note: the above applies to deploying WAR files. EAR files are a different … Read more

Serving static files from alternate path in embedded Jetty

What you need: A DefaultServlet at “https://stackoverflow.com/” (recommended, it is a requirement of the servlet spec) this should be at named dispatcher of “default” (another requirement of servlet spec) An alternate DefaultServlet with your custom static content, configured via init-params Using a different named dispatcher than “default” (to avoid a name collision between other servlet … Read more