我們有一個GWT應用程序。使用Maven 3,我們構建並運行GWT應用程序。 當我們在Windows 7上構建和運行並在Windows上的IE上進行測試時,該應用程序運行良好。但是,當我們在Linux上編譯和運行應用程序,然後在Windows上測試IE時,應用程序看起來有所不同。 要排除客戶端問題:我們測試的是完全相同的客戶端 - Windows 7上的Internet Explorer。 進一步調查顯示,Linux服務器上的Javascript與Windows服務器上的Javascript不同。GWT編譯器在Linux和Windows中的行爲不同
有誰知道爲什麼GWT在Linux和Windows上表現不同?我們能做什麼使GWT在Windows和Linux上表現相同。 我們使用Maven 3編譯並運行gwt。
這裏的GWT的插件配置:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.5.0</version> <executions> <execution> <goals> <goal>compile</goal> <goal>i18n</goal> <goal>generateAsync</goal> </goals> </execution> </executions> <configuration> <runTarget>MyApplication.html</runTarget> <hostedWebapp>${webappDirectory}</hostedWebapp> <i18nMessagesBundle>nl.my.app.client.Messages</i18nMessagesBundle> <inplace>true</inplace> </configuration> </plugin>
和這裏的模塊配置:
<?xml version="1.0" encoding="UTF-8"?> <module rename-to='MyApplication'> <inherits name='com.google.gwt.user.User' /> <inherits name="com.google.gwt.i18n.I18N" /> <inherits name='nl.my.module' /> <inherits name="com.sencha.gxt.ui.GXT" /> <inherits name="com.google.common.collect.Collect" /> <inherits name='com.google.gwt.user.Debug' /> <inherits name='nl.my.othermodule' /> <entry-point class='nl.my.MYApplication' /> <source path='client' /> <source path='shared' /> <set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true" /> <extend-property name="locale" values="nl_NL" /> </module>
的應用是建立和使用下面的命令來運行: MVN GWT:運行
哪些編譯輸出之間的差別:
問題是通過增加應用程序的單一HTML文件頭部分以下解決了嗎? –