Last week, I spent some time trying to change the location of my cache/nocache HTML files in my GWT project. I started the project with the gwt-maven-plugin is archetype. The message I posted to the gwt-maven Google Group is below.
Rather than having my application is HTML file in src/main/java/com/mycompany/Application.html, I would like to move it to src/main/webapp/index.html. I tried copying the HTML and adding the following to my index.html, but no dice:
<meta name="gwt:module" content="com.mycompany.Application"/>
Is this possible with the gwt-maven-plugin? I would like to have my main HTML and CSS at the root of my application.
The good news is I figured out a solution using the UrlRewriteFilter that 1) allows hosted mode to work as usual and 2) allows your app to be served up from the root URL (/ instead of /com.company.Module/Application.html). Here is the urlrewrite.xml that makes it all possible.
view source
print?
01.<?xml version="1.0" encoding="UTF-8"?>
02.<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
03. "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
04.
05.<urlrewrite>
06. <rule>
07. <from>/$</from>
08. <to type="forward" last="true">/com.mycompany.app.Application/Application.html</to>
09. </rule>
10. <rule>
11. <from>/index.html</from>
12. <to type="forward" last="true">/com.mycompany.app.Application/Application.html</to>
13. </rule>
14. <-- This last rule is necessary for JS and CSS files -->
15. <rule>
16. <from>^/(.*).(.*)$</from>
17. <to type="forward">/com.mycompany.app.Application/$1.$2</to>
18. </rule>
19.</urlrewrite>
If you are using the gwt-maven plugin, this file goes in src/main/webapp/WEB-INF. In addition, you will need to add the following to your web.xml.
view source
print?
01.<filter>
02. <filter-name>rewriteFilter</filter-name>
03. <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
04.</filter>
05.
06.<filter-mapping>
07. <filter-name>rewriteFilter</filter-name>
08. <url-pattern>/*</url-pattern>
09.</filter-mapping>
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.

Original Source: