
If you are struggling with a long URL in the GWT project, you are at the right place! There is a small trick, which allows URL to be shorter.
URL Transformation Link to heading
From:
https://domain.com/tomcat_context_path/project_name/your_index.html
To:
https://domain.com/tomcat_context_path/
Implementation Steps Link to heading
In order to shorten the URL, follow these 4 simple steps:
Locate your HTML file: Find your
your_index.html
in the projectMove the file: Move it into your WAR/WebContent or whatever folder you use for the Tomcat deployment process
Rename the file: Rename
your_index.html
toindex.html
Update references: Adjust all links in
index.html
corresponding to your public folders (images/css/js and, of course, your main GWT-JS)
Result Link to heading
Now, after the new project deployment, your GWT project will be accessible under its new URL:
https://domain.com/tomcat_context_path/
There is no need to include the index.html
file into the URL, simply because the Tomcat automatically searches for
it (according to default settings of the Apache Tomcat server, of course). Finally, your GWT project will be accessible
under its new URL!
Benefits Link to heading
It’s a simple trick, but greatly improves the user experience.