views:

28

answers:

1

I'm working on a GWT application and would like to branch some logic based on whether the code is running in development mode or is live in production.

For example, when the code needs to make an AJAX call we would like to set the URL depending on mode.

+3  A: 
boolean isDevelopmentMode() {
    return !GWT.isScript() && GWT.isClient();
}
Dean Povey
Note: added GWT.isClient() as otherwise this would be true for server side code.
Dean Povey
I knew there was an easy way to determine this that was eluding me. Thanks!
arrrghnold