How to deploy my web application to jetty9 as root application?

In Jetty 6, if you had
${jetty.home}/contexts/myapp.xml

With Jetty 9.0, move it to
${jetty.home}/webapps/myapp.xml

With Jetty 9.1+, move it to
${jetty.base}/webapps/myapp.xml

Make sure the exploded webapp directory is the same name as your xml file to prevent double deployment.
You also need to change your Context XML File for Jetty 9.
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"><Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/</Set> <Set name="war"><Property name="jetty.home" default="." />/webapps/myapp</Set></Configure>

Or alternatively, just name your exploded webapp directory
${jetty.home}/webapps/ROOT

Documentation found:
http://www.eclipse.org/jetty/documentation/current/configuring-deployment.html
Updated for Jetty 9.1

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容