Is there way for a GWT program to tell if it's in hosted or web mode?

前端 未结 2 1898
广开言路
广开言路 2021-02-09 00:02

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!

2条回答
  •  没有蜡笔的小新
    2021-02-09 00:22

    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.

提交回复
热议问题