2013-04-01 9 views
9

私はjetty6を使用すると、私は次のように使用します、フォルダのコンテキストにあります。このファイルWebアプリケーションをrootアプリケーションとしてjetty9にデプロイするにはどうすればいいですか?

<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

と名付けしかし、桟橋9に切り替えて、最初はそのようなフォルダ「文脈」がありません、 myapp.xmlをtest.xmlのようにwebappsに入れ、jettyを再起動してhttp://localhost:8080に移動すると、ページはアプリケーションではなくデフォルトのままになります。

誰でも私にヒントを教えてもらえますか?桟橋6では

+2

「機能していません」とは、十分な問題の説明ではありません。 –

答えて

19

、あなたは桟橋9.0

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

を持っていた場合、突堤9.1+で

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

に移動し、確認してください

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

に移動展開されたwebappディレクトリは、ダブル展開を防ぐためにXMLファイルと同じ名前です。

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

あなたはまた、突堤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> 

または代わりに、あなたのコンテキストXMLファイルを変更する必要があり、ちょうどあなたの展開webappディレクトリた

${jetty.home}/webapps/ROOT 

ドキュメントに名前を付けます

更新Jetty用ed 9.1

+0

ありがとう、働いているようですが、私のアプリケーションがデプロイされているのを見ることができますが、 "http:// localhost:8080"のページはまだデフォルトです。私のアプリケーションはルートアプリケーションです。 – Tom

-1

/rootまたはroot.warという名前を使用できます。 this linkを参照してください。

関連する問題