why does changing “module -> rename to” attribute

2019-05-10 10:30发布

问题:

I am able to create and run a simple GWT application by creating all the files myself. It works fine and I am able to see the correct display.

I tried playing around the code to enhance my knowledge. What I noticed is that, once I run my app with say module rename to value "testhistory" it works fine.

But after that if I change rename to's value to say "historytokentest" the app gives errors like "Unable to find 'testhistory.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"

If I change the rename to's value back to "testhistory" it again works fine.

Can anyone clear whether there is any relation between entryPoint class name, .gwt.xml file name, module rename to's value & also project name. Can they be changed in the future? (I know its not good to do so but just clearing doubts)

回答1:

If you change the rename-to, it'll change the name of the output files, so you have to update your <script> tag in your HTML host page (from src="testhistory/testhistory.nocache.js" to src="historytokentest/historytokentest.nocache.js"). You don't have to change anything else.



回答2:

Everything can be changed. There will not be any problem if you change the project.

If you want to change/rename your entry point make sure that you are doing it at [modulename].gwt.xml also. Mostly few smarter IDE's will take care of this once you do rename.

Same way for module name changing you have to change it in host page. Nothing extra than that.