Why does GWT not work without? Gwt.codesvr = 127.0.0.1: 9997

I would like to know why GWT does not work without an argument? gwt.codesvr = 127.0.0.1: 9997 in url, I redirect between url's hardcoding modules and I need to set this line not to display the message: Module XXX Must be (re) compiled.

I hope that I will not change these URLs in the future when I switch from host mode to mode ...

So, is there a better way to associate a module with another? I am doing with:

GWT.getHostPageBaseURL() + "UserRegistration.html ?gwt.codesvr=127.0.0.1:9997 " 

Thanks in advance.

+8
gwt
source share
2 answers

This query string argument is looked over by * .nocache.js to force the plugin to load in the dev mode that you installed in your browser, so it connects back to the designated DevMode application.

When you need to redirect between pages, and you want them all to be executed either in dev mode or in web mode, the simplest condition is the argument condition (if possible, a value taken from an existing, rather than hard-coded) to !GWT.isProdMode() :

 if (!GWT.isProdModode()) { // assumes 'url' doesn't contain a query-string yet url += "?gwt.codesvr=" + Window.Location.getParameter("gwt.codesvr"); } 

If you yourself do not use the query string, so it should only exist with the gwt.codesvr parameter or be absent, you can make it even simpler using UrlBuilder :

 UrlBuilder builder = Window.Location.createUrlBuilder(); builder.setPath(GWT.getHostPageBaseURL() + "UserRegistration.html") //don't pass the history token around: builder.setHash(null); // builder.toString() will then keep the same query string. 

and this is not even due to the current β€œmode” in which the application is launched, as it simply unconditionally copies the query string.

+8
source share

This option is for development mode only. Be warned that if you hardcode the URL with this parameter, it’s good that it’s wrong.

0
source share

All Articles