Jürgen has posted 1 posts at DZone. View Full User Profile

Getting Rid of Package-Based GWT URL's

  • submit to reddit

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:

    <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"/>

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.

Your rating: None Average: 3.7 (3 votes)
Published at DZone with permission of its author, Jürgen De Commer.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



Radek Jun replied on Sat, 2008/12/20 - 3:48pm

Interesting, I spent some time with customizating GWT configuration and end up with IFRAME :(.

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 

Jürgen De Commer replied on Tue, 2009/01/06 - 4:21am in response to: Ian Bambury

I don't have to do anything  manually using this configuration , so when I build my application with Maven ... it just works. I get my WAR/EAR file and don't have to do any modifications myself.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.