I have two modules, the Main module and the Included module.
If I start the Main module it will show an interface with an iFrame which contains the Included module with some additional controls around it. I can also start the Included module separately. I have solved this by having two separate .gwt.xml files and two separate entrypoints and the result is then placed in the same war folder.
If I use GWT Compile in eclipse I can add both my entrypoints to the list and it will compile both modules and everything will work correctly.
However if I click the "Run" button in eclipse to have my application run in devmode, then it will only recompile the entrypoint that I access in my 开发者_如何转开发browser. If I access the Main entrypoint then I will get a popup saying "gwt module may need to be recompiled" and devmode will not automatically recompile my Include entrypoint.
Is there someway that I can get devmode in eclipse to -always- recompile all of my modules?
As I understand it, you use an IFrame that contains the host page of a secondary GWT module. This frame's content must also be loaded using the gwt.codesvr=127.0.0.1:9997
parameter, or it would just load the latest compiled version of the GWT javascript without using the devmode server.
You should also make sure the debug configuration in Eclipse contains both modules. You can verify that by not clicking the button directly, but using the menu to open the "Debug Configurations" menu. Assuming you clicked on the "Debug" button before, you should find an existing GWT debug configuration there. Make sure that both modules are listed in the "GWT" tab.
If you have your modules in two different projects, you might have to use two instances of the dev mode server. (remember to use different ports)
Add you included module to your main module. You can do this by adding
<inherits name="fully qualified name of your module"/>
this code in your main.gwt.xml file.
I would contend that this is more of a "project setup" problem, than "how can I get Eclipse to compile all my modules" problem. The reason I say this is, I have yet to see a GWT project where two entry points were necessary/made sense. The main reason to have separate entry points is for reuse (Dev Guide, Dividing code into multiple modules).
The way I would approach the problem is to have your Main module, which includes the controls and iFrame (and have it inherit your Included module), so the same as you are now. Where I would differ is I would set up the Included module to not have an entry point. Instead, if you have a reason to run it separately from the Main module, I would create a "drive"/"launcher" module that also inherits the Included module. However, instead of controls and an iFrame like the Main module, this driver module would consist merely of an entry point and a place to attach your Included module.
You might also check out this question for more discussion in this same vein: Multiple Entry Points in GWT.
精彩评论