0

この質問はとても簡単だと思います。Google App Engine でアプリを作成しました。私はJerseyでJPAとJAX-RSを使用しています。私の web.xml は次のようになります。

<?xml version="1.0" encoding="utf-8" standalone="no"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>com.rest</param-value>
        </init-param>
         <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
 <servlet>
  <servlet-name>SystemServiceServlet</servlet-name>
  <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
  <init-param>
   <param-name>services</param-name>
   <param-value/>
  </init-param>
 </servlet>
 <servlet-mapping>
  <servlet-name>SystemServiceServlet</servlet-name>
  <url-pattern>/_ah/spi/*</url-pattern>
 </servlet-mapping>
 <welcome-file-list>
        <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>

私の index.html は war/WEB-INF/index.html にあります。表示するにはどうすればよいですか?

4

2 に答える 2

1

index.html は、war/index.html のように直接 war の下に置く必要があります。

于 2012-08-17T18:54:37.850 に答える
0

ファイルを war フォルダー自体に保持します。WEB-INF 内に保持しないでください。

取り出したら、localhost:8888/ を指定するだけで、ウェルカム ファイル (index.html) が表示されます。

他の Jsp を WEB-INF 内に保持することができます。直接 URL アクセスからは見えなくなります。

于 2012-08-21T19:00:48.493 に答える