我想創建一個我的GWTApp的戰爭。據很多教程我會創建一個包如下 -如何在eclipse中使用maven在gwt中創建一個.war文件?
<package>war</package>
在
pom.xml
。但是當我在tomcat
上部署戰爭時,它會向我展示404錯誤。戰爭不包含任何主機頁面或依賴關係。
,以下是我pom.xml
文件 -
<modelVersion>4.0.0</modelVersion>
<groupId>testing</groupId>
<artifactId>testing</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<!-- <artifactId>maven-compiler-plugin</artifactId> -->
<artifactId>maven-war-plugin</artifactId>
<!-- <version>3.1</version> -->
<configuration>
<webXml>\mavenWorkspace\testing\war\WEB-INF\web.xml</webXml>
<source/>
<target/>
</configuration>
</plugin>
</plugins>
</build>
和戰爭的結構是這樣
war
META-INF
-maven
-manifest
WEB-INF
-classes
-lib
-web.xml
和lib文件夾只包含gwt-servlet.jar
。
如何訪問Web應用程序(URL)?你能從應用服務器發佈堆棧跟蹤嗎? – mlewandowski
我手動主機上的tomcat –
HTTP狀態404這場戰爭 - /testing-0.0.1-SNAPSHOT/ 類型狀態報告 消息/testing-0.0.1-SNAPSHOT/ 描述所請求的資源(/testing-0.0 .1-SNAPSHOT /)不可用。 Apache Tomcat/6.0.24 –