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

Uppercase / Lowercase URLs

 
Kristian Breifossmo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what to search for finding a solution to my problem so excuse me if an answer for my question exists elsewhere in this forum.

I have two urls which should do the same:

http://www.thesiteinquestion.com/Test

and

http://www.thesiteinquestion.com/test


As you can see the only difference is the upper/lowercase character in "test".


How would I configure Tomcat to treat these the same?

Any help appreciated!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.
Tomcat was written to adhere to the HTTP spec in which it states that URIs are to be case sensitive.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd have to create two mappings that point to the same servlet.
 
Fedor Smirnoff
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also try URL rewriting with Apache
 
Julie Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because the file name is case sensitive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic