-
Bug
-
Resolution: Done
-
Major
-
JWS 3.0.0 GA, JWS 3.0.1 DR1
-
None
The getContext() method incorrectly returns null when requesting the ROOT context ("/"). The following fix resolves the issue:
public ServletContext getContext(String uri) {
// Validate the format of the specified argument
if ((uri == null) || (!uri.startsWith("/")))
return (null);
Context child = null;
try {
// Look for an exact match
Container host = context.getParent();
child = (Context) host.findChild(uri);
if ( (child == null) && "/".equals(uri) )
// fix
The root context was created via:
Context context = embedded.addWebapp("", "/path/to/webapps/ROOT");
https://bz.apache.org/bugzilla/show_bug.cgi?id=57645
http://svn.apache.org/r1662178