Overcomming MS’s Local Machine Zone Lockdown in GWT

GWT developers will notice an annoying problem running the basic default GWT app locally in web mode in IE every time i try this I get a red warning message: “Your web browser must have JavaScript enabled in order for this application to display correctly”. I had to allow the active content  in order to see the web app screen. running in GWT dev mode seems not to raise this warning message. So what’s this all about? it seems IE doesn’t like people opening JavaScript-laced web pages from the local drive for security concern. there is a detailed article here that speaks about this issue  of Microsoft blocking local domain for web applications .

The article above speaks about a new concept introduced by Microsoft called Mark of the web. i tried the method of Mark of the web by adding these two lines at the begining of my GWT html file :

<!-- saved from url=(0014)about:internet -->
<!-- saved from url=(0016)http://localhost --> 

but when i add these two lines and then compile GWT app and open the html file with IE the web app doesn’t show even though the warning message is gone . The reason probably is that -by default- a GWT app is loaded within an iframe, i.e. as another HTML page (*.cache.html), which doesn’t contain the MotW (Mark of the web).
to overcome this problem we can try using the “xs” or “xsiframe” linker, i.e. add one of these lines to our *.gwt.xml:

<add-linker name="xs" />
<add-linker name="xsiframe" />

Those linkers use *.cache.js” files, so the MotW in our host page should be enough. adding the linker to GWT xml module file makes IE warning message go away and I can run the GWT web app locally with IE.
but The “xs” linker has one drawback : it prevents us from using GWT DevMode . another annoyance that we can overcome by using two *.gwt.xml module files: one for web mode testing with ‘xs’ linker and the other without the linker for testing in GWT DevMode.

This may give you an Idea about the coding acrobatics one should go through to overcome the weired Microsoft decision to block totally the Machine local zone for web applications!

GWT KeyPressHandler getCharCode issues

Like hundreds of GWT developers I stepped into the annoying GWT KeyPressEvent.getCharCode() bug problem described here
To turn around this bug i tried using:


the purpose is to access the native event to get the unprocessed code. However if you try the


you will knock your head against browser-specific inconsistencies. For example the getCharCode() from NativeEvent works for me in FireFox 3 but it doesn’t work in Chrome . in Chrome if i press “ENTER” key




in FF3 the two values are equal (’13’).
It appears that a fix for KeyPressHandler was completed and reviewed for this issue . but it is not clear when we could expect it to be released. The fix appears fairly complex, with different browser-specific implementations.
it turns out that this change set is actually exactly what causes the current behavior in Firefox. See the rationale and a workaround/fix (i.e. only use getNativeEvent() when getCharCode returns 0).
the workaround above works but we need to replace ’13’ with ’10’ in the fix code portion below :

} else if (charCode == 13) {


using ’10’ instead of ’13’ in the else if conditional:

} else if (charCode == 10) {


with this new change code works both in chrome and FF3.

Hope this could be helpful for anyone experiencing these GWT keyPress getCharCode() problems.

Eclipse GWT plugin Installation issue

I have been encountering a problem installing GWT eclipse plugin using the update site :


using this update url seems to raise an error:

Unable to Read repository at http://dl.google.com/eclipse/plugin/3.6/content.xml.
Connection reset

A workaround that works for me is to replace gwt eclipse update site with: