Reputation: 21
I have a problem while working with Web application development. My requirement is: I want to give a request from browser to server like this:
[0]: http://localhost:8080/FirstApp/index.html
This is my actual url, which is case sensitive. But, I want to make this url case insensitive. If I give the request like the below, it should work.
[1]: http://localhost:8080/FIRSTAPP/index.html
[2]:http://localhost:8080/fIRSTaPP/index.html
[3]:http://localhost:8080/FiRsTApP/index.html
.
.
.
How can I make a "context path" case insensitive?
Is there any configuration available in servers like tomcat, weblogic, etc, and if there is, then is there any specific configuration for each server or do we generally have to provide an application level implementation.
I have observed in Microsoft IIS server, it provides case insensitive nature. Why not in java web development?
Upvotes: 2
Views: 2946
Reputation: 10961
As already answered by @cletus there is no vendor-independent way of setting the context-root as long as you don't deploy your war-file inside an ear-file. For the application-xml of the ear-file the Java EE Spec points out (p. 252):
The content of the XML elements is in general case sensitive
I don't think any server is handling this different in their deployment-descriptors.
Background is as answered by @Tarlog:
URIs according to RFC 3986 are case sensitive.
If you really need to have a case-insensitive context-root you need to place a web server in front of your application-server which redirects to or proxies /FirstApp
.
Upvotes: 5