Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

support lower and upper case in web page url

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to support lower and upper case in web page url?
e.g.
http://127.0.0.1:8080/Myapp/displayHw
http://127.0.0.1:8080/Myapp/displayhw
are both supported.

I modified web.xml to:


and Myapp-servlet.xml to

Is there a better way than this?
 
parampreet sethi
Greenhorn
Posts: 27
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the better way would be to use a URL Rewrite handler, there you can mention a Regex or the specific URLs From and To.

If you are using Apache in front of your Tomcat server, You can achieve this either by having mod_rewrite module configured for you or if the number of URLs are much lesser then you can use mod_proxy module to forward the URLs to correct address.

You can checkout this http://param-techie.blogspot.com/2010/03/setting-up-url-rewrite-module-on-apache.html for more information on how to set up mod_rewrite module for your Apache server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic