• Post Reply Bookmark Topic Watch Topic
  • New Topic

"case insensitive" url  RSS feed

 
Pradeep LV
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i make my URL to be case insensitive?. I.E my application is testapplication. If anybody types TEStAPPlicatiN in the url, the application(testapplication) should get invoked. I am using JBoss as app server. Please help me.

Pradeep
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Pradeep"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark

p.s. Basically it is just about your last name. LV isn't a real last name.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URLs are case sensitive according to the HTTP specification (everything except the domain name that is, the domain name is NOT case sensitive).
Any server that doesn't check for this is buggy (only ones I know of are very old versions of IIS).
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Jeroen said, i dont think this can be done directly.

However i think this can be done programmatically...

here is how i think i would do it:

1. Let one servlet handle all requests.

2. In the servlet, use HttpServletRequest.getServletPath() to get the name of the servlet actually required.

3. once you get the name os the servlet, get it in the form you require, for ex: do a String.toLower() on it so that you have all servlet names in all small letters.

4. call RequestDispatcher.forward() to forward the request to the particular servlet.

I havent tried it, but this should work. What say, Jeroen?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!