如何将我的Web应用程序作为根应用程序部署到jetty9? [英] How to deploy my web application to jetty9 as root application?

查看:123
本文介绍了如何将我的Web应用程序作为根应用程序部署到jetty9?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用jetty6时,我使用以下内容:

When I use jetty6, I use the following:

<Configure class="org.mortbay.jetty.webapp.WebAppContext">


  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <!-- Required minimal context configuration :                        -->
  <!--  + contextPath                                                  -->
  <!--  + war OR resourceBase                                          -->
  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  <Set name="contextPath">/</Set>
  <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webapps/myapp</Set>

</Configure>

此文件位于文件夹上下文中,名为myapp.xml

this file located in folder contexts,named myapp.xml

但是切换到jetty 9,首先没有这样的文件夹"contexts",我像test.xml一样将myapp.xml放到webapps中,重新启动jetty并导航到http://localhost:8080,页面仍然是默认的,而不是我的申请.

But switch to jetty 9, first there is no such folder "contexts", and I put myapp.xml into webapps just like test.xml, restart jetty and navigate to http://localhost:8080, the page remain the default one, not my application.

有人可以给我一个提示吗?

Can anybody give me a hint?

推荐答案

在Jetty 6中,如果您有

In Jetty 6, if you had

${jetty.home}/contexts/myapp.xml

使用Jetty 9.0,将其移至

With Jetty 9.0, move it to

${jetty.home}/webapps/myapp.xml

使用Jetty 9.1+,将其移至

With Jetty 9.1+, move it to

${jetty.base}/webapps/myapp.xml

确保展开的webapp目录与xml文件名称相同,以防止重复部署.

Make sure the exploded webapp directory is the same name as your xml file to prevent double deployment.

您还需要更改Jetty 9的上下文XML文件.

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>  

或者,只需命名爆炸的webapp目录

Or alternatively, just name your exploded webapp directory

${jetty.home}/webapps/ROOT

找到的文档:

http://www.eclipse.org/jetty/documentation/current/configuring-deployment .html

已更新Jetty 9.1

这篇关于如何将我的Web应用程序作为根应用程序部署到jetty9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆