0

I'm trying to shorten the urls of my website in a web.xml file located on my Jetty server.

If my url is www.website.com/about.html

and I want to make it www.website.com/about

what would I need to add to web.xml?

Thank you.

TJ Keel
  • 53
  • 1
  • 1
  • 7

1 Answers1

0

I would recommend resorting to either a custom javax.servlet.Filter where you could just do a simple HTTP forward about to about.html. You could then register that filter in your web.xml.

Another simpler option to checkout is this project which allows more complicated url rewriting.

https://code.google.com/p/urlrewritefilter/

tjg184
  • 4,508
  • 1
  • 27
  • 54
  • Thank you. How would I write this filter? Could you give me an example or show me where I might find one. I can't find anything on my specific issue. – TJ Keel Jun 25 '15 at 05:19
  • Check this out: http://stackoverflow.com/questions/2725102/how-to-use-a-servlet-filter-in-java-to-change-an-incoming-servlet-request-url – tjg184 Jun 25 '15 at 13:12