All,

I have been looking at bug 13040 and reviewing the current getContext() implementation. I saw Remy's comment from some time ago when fixing some related bugs (http://marc.theaimsgroup.com/?l=tomcat-dev&m=106008981803343&w=2) that this would be better if the spec mandated that the parameter passed to getContext() must be an exact match for a context path.

Having read the 2.4 spec several times I am pretty sure that is does say this, albeit not as directly as it might. I assume (perhaps wrongly) that any changes in this area will generate a lot of debate so I wanted to do the debate and then change the code.

The key parts of the spec are:
SRV.14.2.8 ServletContext
<snip>
public ServletContext getContext(java.lang.String uripath)
<snip>
uripath - a String specifying the context path of another web application in the container.
<snip>

My interpretation is:
SRV.14.2.8 says the parameter is a context path
SRV.4.4 is very clear about what is context path is

Therefore, getContext() must look for an exact match of uripath against the context paths for the currently deployed web-apps.

My proposal, therefore is to change the getContext() implementation to look for an exact match. This is stricter than the current implementation (and may cause problems for some users) but will fix a number of odd behaviours including the one described in bug 13040.

In the unlikely event that no-one disagrees with my interpretation, I'll commit a fix over the weekend to TC4 and TC5. (The 2.3 spec has the exact same wording.)

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to