我使用gwt-maven-plugin和eclipse來創建GWT + Spring webapp。最後,我想讓.war文件被部署到某個應用服務器(tomcat等)。問題是生成的.war文件具有奇怪的結構。 gwt-maven-plugin:webapp結構
然後我在Tomcat上運行的應用程序不工作 - SimpleGWT.html頁面有鏈接到的JavaScript文件,做所有的工作
<script type="text/javascript" language="javascript" src="SimpleGWT/SimpleGWT.nocache.js"></script>
我的猜測是,由於SimpleGWT。 nocache.js位於不在WEB-INF內部的SimpleGWT文件夾內 - 無法訪問 有沒有任何方法可以改變gwt-maven-plugin的選項以獲得正常的webapp結構?這裏是我的pom.xml的一部分
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.6.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see
gwt-maven-plugin documentation at codehaus.org -->
<configuration>
<inplace>true</inplace>
<runTarget>SimpleGWT.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.javacodegeeks.gwtspring.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
你的意思是「正常的webapp結構」,你的WAR對我來說很好看。 (你的'SimpleGWT.html'和'SimpleGWT.css'不在'WEB-INF'中,那麼爲什麼你要'SimpleGWT.nocache.js'在'WEB-INF'中?)什麼是確切的錯誤/您看到將WAR文件部署到Tomcat的問題? –
Tomcat不會抱怨。當SimpleGWT.html得到加載時,它說SimpleGWT/SimpleGWT.nocache.js - 404找不到。當我通過手動重組戰爭將這個腳本放入WEB-INF時,它可以工作 –