Monday, 14 September 2009

Making GWT urls pretty

We've been working on an GWT application for sometime. The url always ended up as

http://server/context/package.name.Application/index.jsp

This is quite ugly. After a little searching, I managed to find this post. The post itself suggests one fix, but in the comments the following tip was outlined.

"Yeah, alternatively you can use the rename-to attribute to pushing the FooModule.gwt.xml down to the root directory."

So expanding that a little, edit the Application.gwt.xml file, adding an attribute to the module token. My entry ended up as 

<module rename-to="gwtFcg">

This changed the application url to the following, which is much prettier

http://server/context/gwtMyName/index.jsp

No comments:

Post a Comment