Jan,

Jan Luehe wrote:
Hi Mark,
<snip>
I agree the current javadocs of ServletContext.getContext() are
ambiguous, and I agree we need to present this case to the
Servlet EG. Maybe there is a small chance to have this resolved
in the Servlet 2.5 timeframe ...

I think it would be more useful to have the "uripath" argument be
interpreted as a full URI rather than a context root, and have
ServletContext.getContext() determine the longest match of the given
"uripath" with the context roots of any deployed contexts.
<snip>
 I agree the current behaviour, which "hides" any foreign contexts
whose context roots match a subdir of the current context, is broken
(in part because of the spec ambiguity), because it returns different
results depending on the context from which the getContext() call is
made.

I don't see why we need to restrict "uripath" to be a context root in
order to fix the current behaviour, though. As I said, returning
the context whose context root has the longest match with the given
"uripath" may make more sense.

Would you agree?


Jan

I have just re-read the spec keeping score of number of times the wording suggests an exact match or a longest match. The result was a draw so I am happy to interpret it either way. Given that the longest match makes the most sense to me and won't break any existing functionality I will take this approach until the EG issues some clarification. Hopefully they will clarify it the "right" way.

Mark


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

Reply via email to