问题
This should be a quickie; just need an answer on short notice...
I'm having to do a bit of maintenance on a webapp deployed under Tomcat 5.5.16 (behind IIS). It's currently set up with URLs in this format:
http://server.com/myapp/UglyServletName1
...and they just want it to be
http://server.com/Friendly
Obviously the servlet-mapping tag in web.xml isn't enough to map the URL outside of /myapp. Basically, I just need to know -- is there a trivial way to do this as a url-pattern or similar mapping within Tomcat, or is it easier to do it in IIS (or the Jakarta ISAPI plugin, for that matter)?
回答1:
You can use Tuckey's URL Rewrite Filter.
来源:https://stackoverflow.com/questions/10427347/tomcat-url-mapping-individual-servlet-to-root-level