SEAM-GWT集成

SEAM-GWT集成,gwt,integration,seam,seam2,Gwt,Integration,Seam,Seam2,我正在尝试将GWT与SEAM集成。我跟着那辆车,试着开那辆车 示例如下 我使用EclipseGalileo创建了一个GWT项目,并创建了示例中给出的类 然后,我将Seam 2.0.2 JAR添加到构建路径中 我使用EclipseUI使用GoogleGWT编译器编译了该应用程序 最后我运行了应用程序 首先,我想知道上述步骤是否正确。运行应用程序后,我没有得到期望的结果 这也是将GWT与Seam集成的唯一方法吗 更新 我已经使用ant运行了这个示例。但我练习的目的是通过EclipseUI运行它 我以

我正在尝试将GWT与SEAM集成。我跟着那辆车,试着开那辆车

示例如下

  • 我使用EclipseGalileo创建了一个GWT项目,并创建了示例中给出的类

  • 然后,我将Seam 2.0.2 JAR添加到构建路径中

  • 我使用EclipseUI使用GoogleGWT编译器编译了该应用程序

  • 最后我运行了应用程序

  • 首先,我想知道上述步骤是否正确。运行应用程序后,我没有得到期望的结果

    这也是将GWT与Seam集成的唯一方法吗

    更新

    我已经使用ant运行了这个示例。但我练习的目的是通过EclipseUI运行它

    我以名称GWTTest创建了自己的项目,并尝试在Eclipse中重新创建该示例

    用户界面。我注意到了一些事情。GWT Compile via EclipseUI在war文件中创建一个名为gwttest的目录。其中,ant创建的目录结构不同

    在这个示例中,AskQuestionWidget getService函数中有一段代码,如下所示

    String endpointURL = GWT.getModuleBaseURL() + "seam/resource/gwt";
    

    如何修改此代码以适应我的目录结构?

    如果需要,请查看/examples/remoting/gwt。从那里运行(确保在使用ANT之前安装了它)

    下面是它的readme.txt文件

    您可以在以下位置查看示例:

    GWT:如果要重建GWT前端,需要下载GWT,并配置build.properties指向它。然后可以从这个目录运行“antgwtcompile”。默认情况下,它是预构建的如果您想使用GWT托管模式,那么请阅读GWT文档中的所有内容


    我们使用seam+richfaces+gwt,效果非常好。虽然我们用maven构建所有东西,但我想您也可以使用ant。总体思路是以GWT开发模式启动整个web应用程序。您不必编译所有内容(对于GWT编译器,这需要很长时间)。开发模式将根据需要编译请求的资源。通过以这种方式运行GWT应用程序,还可以调试客户端代码

    还可以调用GWT方法来响应seam操作

    更新:

    我可以详细介绍一下我们的解决方案:

    Maven

    您的项目应该配置
    打包:war
    。关于使用maven(也包括richfaces)设置seam,有一些官方说明:

    对于GWT,请将以下部分添加到
    pom.xml

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.1.0</version>
      <scope>provided</scope> <!-- prevents from including this in war -->
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>2.1.0</version>
      <scope>provided</scope> <!-- prevents from including this in war -->
    </dependency>
    <dependency>
      <groupId>pl.ncdc.gwt</groupId>
      <artifactId>gwt-servlet-war</artifactId>
      <version>2.1.0</version>
      <type>war</type> <!-- adds gwt-servlet.jar to your war, but not to your classpath -->
    </dependency>
    
    <!-- build section -->
    <build>
      <resources>
        <resource>
          <directory>src/main/resources</directory>
        </resource>
        <resource>
          <directory>src/main/java</directory>
          <includes>
            <include>**/client/**/*.java</include>
            <include>**/client/**/*.properties</include>
            <include>**/shared/**/*.java</include>
            <include>**/shared/**/*.properties</include>
            <include>**/*.gwt.xml</include>
          </includes>
        </resource>
      </resources>
      <testResources>
        <testResource>
          <directory>src/test/java</directory>
          <includes>
            <include>**/client/**/*.java</include>
            <include>**/client/**/*.properties</include>
            <include>**/shared/**/*.java</include>
            <include>**/shared/**/*.properties</include>
            <include>**/*.gwt.xml</include>
          </includes>
        </testResource>
      </testResources>
    <plugins>
      <plugin> <!-- dirty hack for GWT issue #3439 - it is not really fixed -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>remove-javax</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
                <delete dir="${project.build.directory}/classes/javax" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.3.2.google</version>
        <configuration>
          <extraJvmArgs>-Xmx512M</extraJvmArgs>
          <gwtVersion>${gwt.version}</gwtVersion>
          <modules>
            <module>com.company.gwt.project.module.Module</module>
          </modules>
          <soyc>false</soyc>
          <draftCompile>${gwt.draft.compile}</draftCompile> <!-- you can control this with profiles -->
          <localWorkers>2</localWorkers><!-- in theory should speed things up on our quad CPU hudson -->
          <style>${gwt.style}</style> <!-- you can control this with profiles -->
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>gwt-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <includes>**/*GwtTestSuite.java</includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <archiveClasses>true</archiveClasses>
          <warSourceDirectory>src/main/webapp-empty</warSourceDirectory> <!-- just empty dir for workaround -->
          <webResources>
            <resource>
              <directory>src/main/webapp</directory>
              <excludes>
                <exclude>app.*</exclude> <!-- name of you gwt module(s) - rename-to in gwt.xml -->
                <exclude>WEB-INF/web.xml</exclude>
              </excludes>
            </resource>
            <resource>
              <directory>src/main/webapp</directory>
              <includes>
                <include>WEB-INF/web.xml</include>
              </includes>
              <filtering>true</filtering>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
    </build>
    
    <dependency>
      <groupId>com.xemantic.tadedon</groupId>
      <artifactId>tadedon-gwt-dev</artifactId>
      <version>1.0-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    
    并将
    -server com.xemantic.tadedon.gwt.dev.JettyLancher
    添加到您的google web应用程序启动器中。这是maven友好型码头发射器,在某些情况下可能是必要的


    我希望它能帮助你。您对gwt和richfacaes应用程序之间的通信感兴趣吗?

    您好,我使用了ant并构建了上述示例。自述文件似乎已过时。我使用的是seam 2.0.2、gwt 2.0.4,访问此示例的正确url是:您能为我提供更多关于如何进行此操作的想法吗?非常感谢您的详细更新,但不幸的是,我对maven或ant都不是很熟悉。因此,我们必须仔细阅读它们。无论如何谢谢你
    <dependency>
      <groupId>com.xemantic.tadedon</groupId>
      <artifactId>tadedon-gwt-dev</artifactId>
      <version>1.0-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>