2011-03-01 11 views
1

Eclipseファイルからwarappファイルとしてサーブレットプロジェクトをエクスポートし、webapp/helloフォルダ内に配置しました。私はそれを実行するにはどうすればよいwarサーブレットのtomcatが見つかりません

/webapps/hello/hellotest.war

? warファイル内の

私はこの

http://127.0.0.1:8080/hello/foo

を入力したが、それは

を実行に失敗し、これが私のweb.xmlファイルである

<?xml version="1.0" encoding="UTF-8"?> 
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
    <display-name>helloTest</display-name> 
    <servlet> 
     <description> 
     </description> 
     <display-name>foo</display-name> 
     <servlet-name>foo</servlet-name> 
     <servlet-class> 
     foo</servlet-class> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>foo</servlet-name> 
     <url-pattern>/foo</url-pattern> 
    </servlet-mapping> 
    <welcome-file-list> 
     <welcome-file>index.html</welcome-file> 
     <welcome-file>index.htm</welcome-file> 
     <welcome-file>index.jsp</welcome-file> 
     <welcome-file>default.html</welcome-file> 
     <welcome-file>default.htm</welcome-file> 
     <welcome-file>default.jsp</welcome-file> 
    </welcome-file-list> 
</web-app> 
+0

私はあなたがtomcatを使用していると仮定していますか? Tomcatを再起動した後のWebアプリケーションの下のディレクトリ構造は何ですか? – Paul

答えて

1

webappsであなたのhellotest.warファイルを配置Tomcatのフォルダ。 Tomcatインスタンスが実行され、正しく設定されていると仮定すると、アプリケーションはフォルダwebapps/hellotestに自動的に展開されます。 URL http://127.0.0.1:8080/hellotest/からアプリケーションにアクセスできます。

関連する問題