Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT hosted mode not working with Spring + Eclipse + GWT Eclipse plugin

I've been trying to get GWT working with Spring for a while now. Is there anyone who is using official Eclipse GWT plugin with Spring, and who has managed to get hosted mode working with that combination?

I'm using GWTController to initialize GWT through dispatcher-servlet.xml. Since my WEB-INF is not in war, but in WebContent folder, I use "-war WebContent" switch when compiling Java code to .js.

As for hosted mode... if I try to run it through IDE (Run as Web Application) I get "Launch failed - Could not find any host pages in project MyProject." I tried running it with Ant task which goes something like this:

<condition property="XstartOnFirstThread" value="-XstartOnFirstThread">
    <os family="mac"/>
</condition>
<condition property="XstartOnFirstThread" value="">
    <not><os family="mac"/></not>
</condition>

<target name="hosted" depends="" description="Run hosted mode">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
        <classpath>
            <pathelement location="src" />
            <path refid="my-client-classpath" />
        </classpath>
        <jvmarg value="-Xmx256M" />
        <jvmarg line="${XstartOnFirstThread}" />
        <arg value="-startupUrl" />
        <arg value="MyPage.html" />
        <arg value="my.gwt.client.Whatever" />
    </java>
</target>

This results in hosted mode starting, but I get 404 instead of my web page...

EDIT: When I go to hosted mode, I see folder with compiled Javascript code but nothing else. So my question is basically has someone got a good tutorial or a setup he can share? There is a lot of half-baked info on the Net, but I wasn't able to make any of it work.

EDIT 2: Here's my .gwt.xml file, it's pretty basic:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='whatever'>
<!-- Inherit the core Web Toolkit stuff.                        -->
<inherits name='com.google.gwt.user.User' />

<!-- Inherit the default GWT style sheet.  You can change       -->
<!-- the theme of your GWT application by uncommenting          -->
<!-- any one of the following lines.                            -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

<!-- Other module inherits                                      -->

<!-- Specify the app entry point class.                         -->
<entry-point class='my.gwt.client.Whatever' />

<!-- Lokalizacije                                               -->
<extend-property name="locale" values="hr" />

</module>
like image 923
Domchi Avatar asked Oct 23 '09 13:10

Domchi


1 Answers

We used this tutorial to get it working for us, hope it helps

like image 99
jfarrell Avatar answered Oct 02 '22 15:10

jfarrell