I'm curious on what's the best way to do an URL Rewrite, in a java application. Say you have an app called test_app, and I deploy it on tomcat.
By URL Rewrite I mean that instead of accessing the app via host:port/test_app/ , I want to access it by doing host:port/fancy_URL_for_test_app/ .
Question : where is it better to do the URL Rewriting ? On tomcat container, or by using something along the lines of tuckey URLRewriteRule (meaning, rewriting at application level).
It would seem to me that rewriting on tomcat level would be the best way to go, from a design point of view, however I've noticed different opinions here, such as Is there a url rewriting engine for Tomcat/Java? .
Could you please explain why would you choose to do the rewriting on the application level instead of container level ?
NOTE : I'm talking strictly about root context rewrite (i.e. changing host:port/test_app/ into host:port/fancy_root_context/ rather than changing host:port/test_app/login1 into host:port/test_app/login2
Thanks in advance ! Andrei