Bonjour le monde !
Je suis débutant en développement web, veuillez donc excuser mon "éventuelle" idiotie..
J'utilise GWT v. 2.0.4 sous Eclipse 3.4.. j'ai lancé le HelloWorld de google, il fonctionne sans problèmes.. j'ai donc essayé de commencer un projet à partir de zéro sans le HW.. avec juste un VerticalPanel sur lequel y'a un label "Hello", voici ma classe java:
Mon .css
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 package com.day2.client; import com.google.gwt.core.client.*; import com.google.gwt.user.client.ui.*; import com.google.gwt.event.dom.client.*; public class Day2 implements EntryPoint { VerticalPanel panel = new VerticalPanel(); public void onModuleLoad() { panel.add(new Label("Hello")); panel.addStyleName("panel"); RootPanel.get("panel").add(panel); } }
et mon .html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 h1 { font-size: 2em; font-weight: bold; color: #777777; margin: 40px 0px 70px; text-align: center; }
l'Entry ponit est bien défini dans le fichier .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
19
20 <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href="Day2.css"> <title>Hi</title> <script type="text/javascript" language="javascript" src="day2/day2.nocache.js"></script> </head> <body> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"> </iframe> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> </div> </noscript> </body> </html>
le souci c'est que lorsque je run, j'obtiens juste une page blanche sans rien dessus, je comprends pas ou est passé mon label..
Code : Sélectionner tout - Visualiser dans une fenêtre à part <entry-point class='com.day2.client.Day2'/>
EDIT: en changeant de navigateur, sous chrome j'obtiens le message d'erreur suivant: "Plugin failed to connect to hosted mode server at: 127.0.0.1:9997.
Et sous Ecplise:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 12:14:14.750 [ERROR] [day2] Unable to load module entry point class com.day2.client.Day2 (see associated exception for details) java.lang.NullPointerException: null at com.day2.client.Day2.onModuleLoad(Day2.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Unknown Source)
Merci pour toute aide![]()
Partager