i have gwt project very simple: it's 1 module single entrypoint calls gwt.log
in order tell me has compiled , run successfully.
import com.google.gwt.core.client.entrypoint; import com.google.gwt.core.client.gwt; public class tester implements entrypoint { public void onmoduleload() { gwt.log("i have compiled , run successfully"); } }
it compile - spits out bunch of files in war folder.
my understanding of need run (based on http://www.gwtproject.org/doc/latest/faq_debuggingandcompiling.html) need run hosted.html
file in browser , of magic. i've put entire war folder on http server (so can other files without being blocked file:// stuff i've had issues in web development before) , fetched in chrome. nothing. looked @ network monitor in , recorded while refreshing page - file ever loaded hosted.html
:
there no errors or messages in javascript console...
the resulting hosted.html follows:
<html> <head><script> var $wnd = parent; var $doc = $wnd.document; var $modulename, $modulebase, $entry ,$stats = $wnd.__gwtstatsevent ? function(a) {return $wnd.__gwtstatsevent(a);} : null ,$sessionid = $wnd.__gwtstatssessionid ? $wnd.__gwtstatssessionid : null; // lightweight metrics if ($stats) { var modulefuncname = location.search.substr(1); var modulefunc = $wnd[modulefuncname]; var modulename = modulefunc ? modulefunc.modulename : "unknown"; $stats({modulename:modulename,sessionid:$sessionid,subsystem:'startup',evtgroup:'modulestartup',millis:(new date()).gettime(),type:'moduleevalstart'}); } var $hostedhtmlversion="2.1"; var gwtonload; var $hosted = "localhost:9997"; function loadiframe(url) { var topdoc = window.top.document; // create iframe var iframediv = topdoc.createelement("div"); iframediv.innerhtml = "<iframe scrolling=no frameborder=0 src='" + url + "'>"; var iframe = iframediv.firstchild; // mess iframe style little var iframestyle = iframe.style; iframestyle.position = "absolute"; iframestyle.borderwidth = "0"; iframestyle.left = "0"; iframestyle.top = "0"; iframestyle.width = "100%"; iframestyle.backgroundcolor = "#ffffff"; iframestyle.zindex = "1"; iframestyle.height = "100%"; // update top window's document's body's style var hostbodystyle = window.top.document.body.style; hostbodystyle.margin = "0"; hostbodystyle.height = iframestyle.height; hostbodystyle.overflow = "hidden"; // insert iframe topdoc.body.insertbefore(iframe, topdoc.body.firstchild); } var ua = navigator.useragent.tolowercase(); if (ua.indexof("gecko") != -1) { // install eval wrapper on ff avoid evalerror problem var __eval = window.eval; window.eval = function(s) { return __eval(s); } } if (ua.indexof("chrome") != -1) { // work around __gwt_objectid appearing in js objects var hop = object.prototype.hasownproperty; object.prototype.hasownproperty = function(prop) { return prop != "__gwt_objectid" && hop.call(this, prop); }; // same in our parent -- see issue 4486 // note: have changed when support non-iframe-based devmode var hop2 = parent.object.prototype.hasownproperty; parent.object.prototype.hasownproperty = function(prop) { return prop != "__gwt_objectid" && hop2.call(this, prop); }; } // wrapper call js methods, need both able supply // different method lookup , exception function __gwt_jsinvoke(thisobj, methodname) { try { var args = array.prototype.slice.call(arguments, 2); return [0, window[methodname].apply(thisobj, args)]; } catch (e) { return [1, e]; } } var __gwt_javainvokes = []; function __gwt_makejavainvoke(argcount) { return __gwt_javainvokes[argcount] || __gwt_domakejavainvoke(argcount); } function __gwt_domakejavainvoke(argcount) { // ie6 won't eval() anonymous functions except r-values var arglist = ""; (var = 0; < argcount; i++) { arglist += ",p" + i; } var arglistnocomma = arglist.substring(1); return eval( "__gwt_javainvokes[" + argcount + "] =\n" + " function(thisobj, dispid" + arglist + ") {\n" + " var result = __static(dispid, thisobj" + arglist + ");\n" + " if (result[0]) {\n" + " throw result[1];\n" + " } else {\n" + " return result[1];\n" + " }\n" + " }\n" ); } /* * used create tear-offs of java methods. each function corresponds * 1 dispid, , embeds argument count. "this" * value context in function being executed. * function-object identity preserved caching in sparse array. */ var __gwt_tearoffs = []; var __gwt_tearoffgenerators = []; function __gwt_maketearoff(proxy, dispid, argcount) { return __gwt_tearoffs[dispid] || __gwt_domaketearoff(dispid, argcount); } function __gwt_domaketearoff(dispid, argcount) { return __gwt_tearoffs[dispid] = (__gwt_tearoffgenerators[argcount] || __gwt_domaketearoffgenerator(argcount))(dispid); } function __gwt_domaketearoffgenerator(argcount) { // ie6 won't eval() anonymous functions except r-values var arglist = ""; (var = 0; < argcount; i++) { arglist += ",p" + i; } var arglistnocomma = arglist.substring(1); return eval( "__gwt_tearoffgenerators[" + argcount + "] =\n" + " function(dispid) {\n" + " return function(" + arglistnocomma + ") {\n" + " var result = __static(dispid, this" + arglist + ");\n" + " if (result[0]) {\n" + " throw result[1];\n" + " } else {\n" + " return result[1];\n" + " }\n" + " }\n" + " }\n" ); } function __gwt_makeresult(isexception, result) { return [isexception, result]; } function __gwt_disconnected() { // prevent double-invocation. window.__gwt_disconnected = new function(); // in timeout can sure have clean stack. window.settimeout(__gwt_disconnected_impl, 1); } function __gwt_disconnected_impl() { __gwt_displayglassmessage('gwt code server disconnected', 'most likely, closed gwt development mode. or, might have lost ' + 'network connectivity. fix this, try restarting gwt development mode , ' + 'refresh page.'); } // keep track of z-index allow layering of multiple glass messages var __gwt_glassmessagezindex = 2147483647; // note method used modulespace.java function __gwt_displayglassmessage(summary, details) { var topwin = window.top; var topdoc = topwin.document; var outer = topdoc.createelement("div"); // not insert whitespace or outer.firstchild text node. outer.innerhtml = '<div style="position:absolute;z-index:' + __gwt_glassmessagezindex-- + ';left:50px;top:50px;width:600px;color:#fff;font-family:verdana;text-align:left;">' + '<div style="font-size:30px;font-weight:bold;">' + summary + '</div>' + '<div style="font-size:15px;">' + details + '</div>' + '</div>' + '<div style="position:absolute;z-index:' + __gwt_glassmessagezindex-- + ';left:0px;top:0px;right:0px;bottom:0px;filter:alpha(opacity=60);opacity:0.6;background-color:#000;"></div>' ; topdoc.body.appendchild(outer); var glass = outer.firstchild; var glassstyle = glass.style; // scroll top , remove scrollbars. topwin.scrollto(0, 0); if (topdoc.compatmode == "backcompat") { topdoc.body.style["overflow"] = "hidden"; } else { topdoc.documentelement.style["overflow"] = "hidden"; } // steal focus. glass.focus(); if ((navigator.useragent.indexof("msie") >= 0) && (topdoc.compatmode == "backcompat")) { // ie quirks mode doesn't support right/bottom, support this. glassstyle.width = "125%"; glassstyle.height = "100%"; } else if (navigator.useragent.indexof("msie 6") >= 0) { // ie6 doesn't have real standards mode, have use hacks. glassstyle.width = "125%"; // past scroll bar area. // nasty css; onresize better outer window won't let add listener ie. glassstyle.setexpression("height", "document.documentelement.clientheight"); } $doc.title = summary + " [" + $doc.title + "]"; } function findpluginobject() { try { return document.getelementbyid('pluginobject'); } catch (e) { return null; } } function findpluginembed() { try { return document.getelementbyid('pluginembed') } catch (e) { return null; } } function findpluginxpcom() { try { return __gwt_hostedmodeplugin; } catch (e) { return null; } } gwtonload = function(errfn, modname, modbase){ $modulename = modname; $modulebase = modbase; // note order important var pluginfinders = [ findpluginxpcom, findpluginobject, findpluginembed, ]; var topwin = window.top; var url = topwin.location.href; if (!topwin.__gwt_sessionid) { var ascii_exclamation = 33; var ascii_tilde = 126; var chars = []; (var = 0; < 16; ++i) { chars.push(math.floor(ascii_exclamation + math.random() * (ascii_tilde - ascii_exclamation + 1))); } topwin.__gwt_sessionid = string.fromcharcode.apply(null, chars); } var plugin = null; (var = 0; < pluginfinders.length; ++i) { try { var maybeplugin = pluginfinders[i](); if (maybeplugin != null && maybeplugin.init(window)) { plugin = maybeplugin; break; } } catch (e) { } } if (!plugin) { // try searching v1 plugin backwards compatibility var found = false; (var = 0; < pluginfinders.length; ++i) { try { plugin = pluginfinders[i](); if (plugin != null && plugin.connect($hosted, $modulename, window)) { return; } } catch (e) { } } loadiframe("http://www.gwtproject.org/missing-plugin/"); } else { if (plugin.connect(url, topwin.__gwt_sessionid, $hosted, $modulename, $hostedhtmlversion)) { // take on onunload function, wrapping existing call if exists var oldunload = window.onunload; window.onunload = function() { // run wrapped unload first in case running gwt code !!oldunload && oldunload(); try { // wrap in try/catch since plugins not required supply plugin.disconnect(); } catch (e) { } }; } else { if (errfn) { errfn(modname); } else { __gwt_displayglassmessage( "plugin failed connect development mode server @ " + simpleescape($hosted), "follow troubleshooting instructions @ " + "<a href='http://code.google.com/p/google-web-toolkit/wiki/troubleshootingoophm'>" + "http://code.google.com/p/google-web-toolkit/wiki/troubleshootingoophm</a>"); } } } } function simpleescape(originalstring) { return originalstring.replace(/&/g,"&") .replace(/</g,"<") .replace(/>/g,">") .replace(/\'/g, "'") .replace(/\"/g,"""); } // lightweight metrics window.fireonmoduleloadstart = function(classname) { $stats && $stats({modulename:$modulename, sessionid:$sessionid, subsystem:'startup', evtgroup:'modulestartup', millis:(new date()).gettime(), type:'onmoduleloadstart', classname:classname}); }; window.__gwt_module_id = 0; </script></head> <body> <font face='arial' size='-1'>this html file development mode support.</font> <script><!-- // lightweight metrics $stats && $stats({modulename:$modulename, sessionid:$sessionid, subsystem:'startup', evtgroup:'modulestartup', millis:(new date()).gettime(), type:'moduleevalend'}); // oophm supports iframelinker var query = parent.location.search; if (!findpluginxpcom()) { document.write('<embed id="pluginembed" type="application/x-gwt-hosted-mode" width="10" height="10">'); document.write('</embed>'); document.write('<object id="pluginobject" classid="clsid:1d6156b6-002b-49e7-b5ca-c138fb843b4e">'); document.write('</object>'); } // old query parameter if don't find new 1 var idx = query.indexof("gwt.codesvr="); if (idx >= 0) { idx += 12; // "gwt.codesvr=".length() == 12 } else { idx = query.indexof("gwt.hosted="); if (idx >= 0) { idx += 11; // "gwt.hosted=".length() == 11 } } if (idx >= 0) { var amp = query.indexof("&", idx); if (amp >= 0) { $hosted = query.substring(idx, amp); } else { $hosted = query.substring(idx); } // according rfc 3986, of component's characters (e.g., ':') // reserved , *may* escaped. $hosted = decodeuricomponent($hosted); } query = window.location.search.substring(1); if (query && $wnd[query]) settimeout($wnd[query].onscriptload, 1); --></script></body></html>
what do?
Comments
Post a Comment