You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Robert Priest <Ro...@bentley.com> on 2003/04/23 19:41:34 UTC

FW: Ignore case on a element

I think I found a solution. I was wondering if you guys would take this.
I admit it is simple but effective.

The list of Contexts are maintained in:

a hashmap ContainerBase.children.

I modified 

ContainerBase.addChildInternal(Container child) to add all the contexts with
key for each one being the 
name in UPPERCASE (Simple, I know).

Also, when attempting to find context, StandardHost.map(String uri) calls
ContainerBase.findChild(String name). 

So I modified ContainerBase.findChild(String name) to retrieve a COntext
from the ContainerBase.children hashmap using the UPPERCASE of the "name"
parameter.

This works fine for me.
This enables me to hit my servlet using:

http://localhost:8080/WEL
http://localhost:8080/wel
http://localhost:8080/WeL

or any other combination for my "WEL" servlet.

Would you guys consider adding this change to the CVS tree.

I think it makes sense. Is there really any reason why you would want a
case-sensitive url?


-----Original Message-----
From: Robert Priest [mailto:Robert.Priest@bentley.com]
Sent: Wednesday, April 23, 2003 10:48 AM
To: 'Tomcat Users List'
Subject: Ignore case on a <Context/> element


Hello,

I have an application: http://localhost:8080/WEL

and for it I have a context setup as:

 <Context path="/WEL" docBase="WEL" debug="0" reloadable="true">
			     <Logger
className="org.apache.catalina.logger.FileLogger"
			     prefix="PW_WEL." suffix=".log"
timestamp="true"/>
		     </Context>


but I need that "/WEL" path to be case-insensitive. So that a user can hit
either http://localhost:8080/WEL or http://localhost:8080/wel and the same
instance of the servlet 
is hit.

if I set up two <Context/> elements, like so:

 <Context path="/WEL" ...>
 <Context path="/wel" ...>

then that will essentially cause two instances of my servlet to be started.

Does anyone know how to ignore the case for a context path? Maybe I missed
it, but I didn't see anything in the documentation.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org