Ho cercato di far funzionare GWT con Spring per un po 'di tempo. C'è qualcuno che usa il plug-in Eclipse GWT ufficiale con Spring e chi è riuscito a far funzionare la modalità host con quella combinazione?La modalità host GWT non funziona con Spring + Eclipse + GWT Plug-in Eclipse
Sto utilizzando GWTController per inizializzare GWT tramite dispatcher-servlet.xml. Poiché il mio WEB-INF non è in guerra, ma nella cartella WebContent, utilizzo lo switch "-war WebContent" quando compilo il codice Java in .js.
Come per la modalità hosted ... se provo a eseguirlo tramite IDE (Esegui come applicazione Web) ottengo "Avvio non riuscito - Impossibile trovare pagine host nel progetto MyProject". Ho provato a correre con task Ant che va qualcosa come questo:
<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>
Questo si traduce in partenza modalità hosted, ma ottengo 404 al posto della mia pagina web ...
EDIT: Quando vado al ospitato modalità, vedo la cartella con codice JavaScript compilato ma nient'altro. Quindi la mia domanda è fondamentalmente qualcuno ha avuto un buon tutorial o un setup che può condividere? Ci sono molte informazioni infarcite in rete, ma non sono riuscito a far funzionare nulla.
EDIT 2: Ecco il mio file di .gwt.xml, è piuttosto semplice:
<?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>
potete inserire l'URL che il browser cerca di accedere? –
L'URL è uno degli argomenti nell'attività Ant - in questo caso "http: // localhost: 8080/MyPage.html", che funziona quando avvio normalmente Tomcat ma non funziona in modalità host. – Domchi
Puoi pubblicare il tuo cfg modulo? Stai usando l'attributo rename-to? –