WebMetaData wmd = (WebMetaData)di.metaData;
dep.addAttachment(WebMetaData.class, wmd);
if (di.parent != null)
{
J2eeApplicationMetaData appmd = (J2eeApplicationMetaData)di.parent.metaData;
if(appmd!=null) // An ESB case, They deploy a *.war inside *.esb
{
Iterator it = appmd.getModules();
while (it.hasNext())
{
J2eeModuleMetaData module = (J2eeModuleMetaData)it.next();
if (module.getFileName().equals(dep.getSimpleName()))
contextRoot = module.getWebContext();