After many hours of research over many days, I have found an utterly simple way to change the URL used to access a Vaadin app:
⇒
Rename the WAR file
Example:
• Domain is "
acme.com
"
• Vaadin app name is "
AcmeInvoices
"
When use Eclipse Indigo feature to export (
File > Export > Web > WAR file)
, I use the default name. In this case, "
AcmeInvoices.war
".
I move that war file to Tomcat 7, start Tomcat, and Tomcat auto-deploys the app including expanding the war file back to a folder.
Then I can reach the app using this URL:
http://www.acme.com/AcmeInvoices
But what if I want a simpler URL such as this:
http://www.acme.com/invoices
To make that my URL:
[1]
On my deployment server, shutdown Tomcat.
[2]
Delete the folder expanded from the WAR file.
[3]
Rename the "
AcmeInvoices.war
" file to "
invoices.war
".
[4]
Start Tomcat, letting it auto-deploy the app.
[5]
Note the newly created folder "
invoices
".
[6]
Test the app using the new URL,
http://www.acme.com/invoices/
Similarly, if you want the URL:
http://www.acme.com/app/
…just rename your
AcmeInvoices.war
file to "
app.war
" when deploying.
At first thought, this seemed so simple and easy that I suspected that I must be “cheating”. But on second thought, this seems perfectly legitimate. Is it?
–Basil Bourque