Is there way for a GWT program to tell if it's in hosted or web mode?
Question
I would like my GWT program to be able to determine whether it's in hosted mode or in web mode. Is there a way to do this?
Thanks!
Solution
GWT.isScript() returns true in non hosted mode and false in hosted mode.
OTHER TIPS
Be careful with this. You still can't run unemulated Java code in the statement.
if(GWT.isScript()) {
//some code not in the JRE emulation here
}
The example code will cause compile time problems.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow