Web applications 集成Spring和GWT(配置文件)

Web applications 集成Spring和GWT(配置文件),web-applications,gwt,spring-mvc,gwt-rpc,Web Applications,Gwt,Spring Mvc,Gwt Rpc,我不知道如何设置web.xml、myproject.gwt.xml和spring-servlet.xml来集成gwt和spring框架。 我在跟踪这个链接,我得到了这个问题 这是myproject.gwt.xml <module rename-to='ZzSampleGWT204Project'> <inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gwt.user.t

我不知道如何设置web.xml、myproject.gwt.xml和spring-servlet.xml来集成gwt和spring框架。 我在跟踪这个链接,我得到了这个问题

这是myproject.gwt.xml

<module rename-to='ZzSampleGWT204Project'>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class='de.mxro.zz.zzsamplegwt204project.client.ZzSampleGWT204Project'/>
  <servlet path='/myService' class='de.mxro.zz.zzsamplegwt204project.server.MyServiceImpl'/>
  <source path='client'/>
  <source path='shared'/>
</module>
}

请让我知道我错在哪里

如果有人能为我提供一个非常简单的项目,展示如何将gwt和spring(MVC,Security)集成在一起,我会很高兴


感谢Bahador Biglari

考虑到您没有提供堆栈跟踪,我假设您无法让模块执行任何操作?您应该确保您正在处理的任何HTML文件实际上都已将GWT模块加载到页面中:

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

此外,如果您还没有使用Eclipse,那么应该考虑使用Eclipse。Eclipse使调试、编译和修改JavaGWT代码变得更加容易

查看本教程,至少可以让GWT应用程序本身正常工作:


我认为问题在于servlet配置,这就是为什么我将配置文件附加到servlet上,我也使用eclipse。
<beans>
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
        <map>
            <entry key="myService">
                <ref bean="ServiceController"/>
            </entry>
        </map>
    </property>
</bean>

<bean id="ServiceController" class="de.mxro.zz.zzsamplegwt204project.server.ServletWrappingController">
<property name="servletName" value="myService"/>
<property name="servletInstance"><ref bean="myService"/>
</property>
</bean>

<bean id="myService" class="de.mxro.zz.zzsamplegwt204project.server.MyServiceImpl">
</bean>
public void onModuleLoad() {
final Label label = new Label("this is a label");
final MyServiceAsync svc = (MyServiceAsync)GWT.create(de.mxro.zz.zzsamplegwt204project.client.MyService.class);
ServiceDefTarget endpoint = (ServiceDefTarget) svc;
endpoint.setServiceEntryPoint("services/myService");

final AsyncCallback callback = new AsyncCallback() {
    public void onSuccess(Object result) {
        label.setText(result.toString());
    }
    public void onFailure(Throwable ex) {
        label.setText(ex.toString());
    }
};

Button button = new Button("Click ME", new ClickHandler() {
    public void onClick(ClickEvent arg0) {
        svc.myMethod("Do Something", callback);
    }
});
RootPanel.get(null).add(button);
<script type="text/javascript" language="javascript" src="stockwatcher/stockwatcher.nocache.js"></script>