aspose file tools
The moose likes Servlets and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark ""case insensitive" url" Watch ""case insensitive" url" New topic
Author

"case insensitive" url

Pradeep LV
Greenhorn

Joined: Nov 05, 2004
Posts: 8
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

Joined: Feb 05, 2001
Posts: 17234
    
    1

"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.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
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).


42
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225
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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: "case insensitive" url
 
Similar Threads
Access Denied while accessing files present on same machine!
Parameter passing method is not working in JSF 2 (with el api jars el-api-2.2.jar & el-impl-2.2.jar)
is the search case sensitive?
Need to get the full path upto application name
need case insensitive url