首页 文章

gwt-maven-plugin:webapp结构

提问于
浏览
1

我正在使用gwt-maven-plugin和eclipse来创建GWT Spring webapp . 最后我想将.war文件部署到某个应用服务器(tomcat等) . 问题是生成的.war文件结构奇怪 .
enter image description here

然后我在Tomcat上运行应用程序不起作用 - SimpleGWT.html页面有一个链接到javascript文件,它可以完成所有工作

<script type="text/javascript" language="javascript" src="SimpleGWT/SimpleGWT.nocache.js"></script>

我的猜测是因为位于SimpleGWT文件夹内的SimpleGWT.nocache.js不在WEB-INF里面 - 它无法访问有没有办法改变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>

1 回答

  • 0

    它的问题主要与访问HTML页面中的静态资源有关 .

    您使用的 relative path 没有"/"前缀 . 这是指向Web服务器根目录的绝对路径 .

    Spring MVC 应用程序 org.springframework.web.servlet.DispatcherServlet 负责提供Web应用程序的所有内容 .

    你为上面的servlet映射定义了什么 url-pattern ?请尝试使用 *.html/* 作为 url-pattern .

    有关Unable to load java script files in Jetty webapplication的更多信息,请参阅 .

相关问题