Nicer, shorter, GWT url's

By Confusion on Wednesday 05 November 2008 12:18
Categories: Java, Software engineering, Views: 2599

A thorn in the side of every GWT developer must be the ridiculous URLs it produces. Please, come and visit our wonderful webapp at
http://company.com/thisapp/com.company.app.module/Module.html
... very attractive... Of course, you can have http://company.com/thisapp/ redirect there, but still.

Fortunately, there is an easy way to shorten the URL, as explained in this not so aptly named thread in the Google Groups group on GWT. If you choose a decent module name, you end up with
http://company.com/module/Module.html, which is acceptable.

If you use the maven-gwt plugin to build your project, you need to modify both the compile targets and the run target to

code:
1
2
3
4
<compileTargets>
    <value>Module</value>
</compileTargets>
<runTarget>Module/Module.html</runTarget>

Volgende: Toeval is niet intuïtief 24-11
Volgende: Converting a certificate + key to a usable Java keystore 31-10

Comments


By T.net user cryforhelp, Wednesday 05 November 2008 14:33

What the hell is GWT?



By Scott Blum, Friday 07 November 2008 18:59

By the way, in GWT 1.6 you should be a lot happier. We're moving to a more WAR style deployment model. In the new model, you'd actually put your HTML into the top of the war directory. It would then reference your module script which would be compiled into a subdirectory. There will also be controls withing your .gwt.xml file to make this subdirectory (and the script itself) shorter if you like.

Look something like this:

war/
war/Module.html
war/compiled/
war/compiled/myModule.nocache.js

Server side code would go into WEB-INF/classes as per normal.

Comment form
(required)
(required, but will not be displayed)
(optional)

Please enter the characters you see in the image below: