Professor Chaos
Professor Chaos

Reputation: 9060

tomcat simple redirection

I have a page that's accessible like this

   http://site/foo.html

Is it possible to make is available at

   http://site/foo

just changing the configuration in web.xml?

I'm migrating an application and the second url is bookmarked and linked in several places.

Upvotes: 1

Views: 195

Answers (1)

BalusC
BalusC

Reputation: 1108557

Is it possible to make ... just changing the configuration in web.xml?

No. You need to either homegrow a simple Filter for this which transparently forwards the incoming requests based on their URI to the desired resources by RequestDispatcher#forward(), or to use a 3rd party one such as Tuckey's URL rewrite filter which is much similar to the well known Apache HTTPD's mod_rewrite.

Upvotes: 2

Related Questions