有没有办法让GWT程序判断它是处于托管模式还是Web模式?

我希望我的GWT程序能够确定它是处于托管模式还是处于Web模式。 有没有办法做到这一点?

谢谢!

GWT.isScript()在非托管模式下返回true,在托管模式下返回false。

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/core/client/GWT.html#isScript()

小心这个。 您仍然无法在语句中运行未经过模拟的Java代码。

if(GWT.isScript()) { //some code not in the JRE emulation here } 

示例代码将导致编译时问题。