Featured image

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:

  1. Locate your HTML file: Find your your_index.html in the project

  2. Move the file: Move it into your WAR/WebContent or whatever folder you use for the Tomcat deployment process

  3. Rename the file: Rename your_index.html to index.html

  4. 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.