Bonjour,
J'ai développé un projet GWt 1.7 + SmartGwt 1.2. Le programme fonctionne bien en host mode (y compris les rpc).
Par contre en déploiement sous tomcat, les rpc ne fonctionnent pas, je ne voie en effet que l'ecran principal, sans les données; les events fonctionnent bien.
Je joins quelques extraits de code.
web.xml
IndicatorIhm.gwt.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name> IndicatorGwt</display-name> <servlet> <servlet-name>IndicatorIhmServiceDb</servlet-name> <servlet-class> indicator.main.web.server.IndicatorIhmServiceDbImpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>IndicatorIhmServiceDb</servlet-name> <url-pattern>/IndicatorIhmServiceDb</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>IndicatorIhm.html</welcome-file> </welcome-file-list> </web-app>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <?xml version="1.0" encoding="UTF-8"?> <module> <!-- Inherit the core Web Toolkit stuff. --> <inherits name="com.google.gwt.user.User"/> <inherits name="com.smartgwt.SmartGwt"/> <inherits name="com.google.gwt.visualization.Visualization"/> <!-- Specify the app entry point class. --> <entry-point class="indicator.main.web.client.IndicatorIhm"/> <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"/> --> <source path='client'/> <source path='bean'/> <servlet class="indicator.main.web.server.IndicatorIhmServiceDbImpl" path="/IndicatorIhmServiceDb"/> </module>
EntryPoint
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 public class IndicatorIhm implements EntryPoint { private IndicatorScreen indicatorScreen; private IndicatorIhmServiceDbAsync async; private PeriodicityIndicator periodicityIndicator; private int timeGmtOffset; public void onModuleLoad() { //initialisations indicatorScreen = new IndicatorScreen(); initData(); //les events d'ihm (...) //affichage indicatorScreen.draw(); } public void initData() { async = IndicatorIhmServiceDb.Util.getInstance(); //avec ou sans les 2 lignes suivantes, meme constat meme probleme // ServiceDefTarget asyncEndPoint = (ServiceDefTarget) async; // asyncEndPoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/IndicatorIhmServiceDb"); async.getAllSearchIndicator(new SearchIndicatorCallback()); (...) } (...) }
IndicatorIhmServiceDb
IndicatorIhmServiceDbAsync
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 @RemoteServiceRelativePath("IndicatorIhmServiceDb") public interface IndicatorIhmServiceDb extends RemoteService { public static class Util { public static IndicatorIhmServiceDbAsync getInstance() { return GWT.create(IndicatorIhmServiceDb.class); } } public SearchIndicatorList getAllSearchIndicator(); (...) }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 public interface IndicatorIhmServiceDbAsync { public void getAllSearchIndicator(AsyncCallback<SearchIndicatorList> callback); (...) }
IndicatorIhmServiceDbImpl
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 public class IndicatorIhmServiceDbImpl extends RemoteServiceServlet implements IndicatorIhmServiceDb { private static final long serialVersionUID = 0L; private IDao dao; public IDao getDao() { return dao; } public void setDao(IDao dao) { this.dao = dao; } public void setDao() { this.dao = new Dao(); } public SearchIndicatorList getAllSearchIndicator() { setDao(); return dao.getAllSearchIndicator(); } (...) }
Partager