332907 make context name and children context consistent for webapps
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3122 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
11de671982
commit
70d0d0d1f2
|
@ -25,10 +25,10 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
import org.eclipse.jetty.server.handler.AbstractHandlerContainer;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
public class AbstractHandlerMBean extends ObjectMBean
|
||||
{
|
||||
/* ------------------------------------------------------------ */
|
||||
public AbstractHandlerMBean(Object managedObject)
|
||||
{
|
||||
super(managedObject);
|
||||
|
@ -88,7 +88,15 @@ public class AbstractHandlerMBean extends ObjectMBean
|
|||
/* ------------------------------------------------------------ */
|
||||
protected String getContextName(ContextHandler context)
|
||||
{
|
||||
String name=context.getDisplayName();
|
||||
String name = null;
|
||||
|
||||
if (context.getContextPath()!=null && context.getContextPath().length()>0)
|
||||
{
|
||||
int idx = context.getContextPath().lastIndexOf(File.separator);
|
||||
name = idx < 0 ? context.getContextPath() : context.getContextPath().substring(++idx);
|
||||
if (name==null || name.length()==0)
|
||||
name= "ROOT";
|
||||
}
|
||||
|
||||
if (name==null && context.getBaseResource()!=null)
|
||||
{
|
||||
|
@ -104,14 +112,6 @@ public class AbstractHandlerMBean extends ObjectMBean
|
|||
}
|
||||
}
|
||||
|
||||
if (name==null && context.getContextPath()!=null && context.getContextPath().length()>0)
|
||||
{
|
||||
int idx = context.getContextPath().lastIndexOf(File.separator);
|
||||
name = idx < 0 ? context.getContextPath() : context.getContextPath().substring(++idx);
|
||||
if (name==null || name.length()==0)
|
||||
name= "ROOT";
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue