Getting Rid of Package-Based GWT URL's
Deploying a fancy GWT application loses a lot of its shine when you see a my.package.gwt url in your browser. To get rid of this, you only need two extra lines of configuration in your application module:
<module>
<source path="my/package/gwt"/>
<public path="gwt/public"/>
<inherits name='com.google.gwt.user.User'/>
<entry-point class='my.package.gwt.Application'/>
<stylesheet src="gwt.css"/>
</module>
This source node points to the Java application implementation, the public node to the application's resources.
There's one thing you need to keep in mind, though: both paths are considered to be relative to the module configuration file.
- Login or register to post comments
- 3201 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
radek.jun replied on Sat, 2008/12/20 - 3:48pm
Alen Vrecko replied on Sat, 2008/12/20 - 6:15pm
Yeah, alternatively you can use the rename-to attribute to pushing the FooModule.gwt.xml down to the root directory.
You can always link the script from your foo.html to /com.foo.bar/Foo.nocache.js or manually edit the output directory name and nocache.js.
One thing I noticed with GWT is that at first it looks very rigid while one has quite a great deal of flexibility.
Ian Bambury replied on Tue, 2008/12/30 - 10:51am
You don't need to do any of that.
Just take all the files inside the folder with the package name and put them anywhere you like on the server
aminal replied on Tue, 2009/01/06 - 4:21am
in response to: gzornenplat