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.
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
posted
0
As Jeroen said, i dont think this can be done directly.
However i think this can be done programmatically...
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.