415401 WebAppProvider: override XmlConfiguration.initializeDefaults
This commit is contained in:
parent
e2e1b47edf
commit
5d21e4246b
|
@ -264,9 +264,24 @@ public class WebAppProvider extends ScanningAppProvider
|
|||
|
||||
if (resource.exists() && FileID.isXmlFile(file))
|
||||
{
|
||||
XmlConfiguration xmlc = new XmlConfiguration(resource.getURL());
|
||||
XmlConfiguration xmlc = new XmlConfiguration(resource.getURL())
|
||||
{
|
||||
@Override
|
||||
public void initializeDefaults(Object context)
|
||||
{
|
||||
super.initializeDefaults(context);
|
||||
|
||||
xmlc.getIdMap().put("Server",getDeploymentManager().getServer());
|
||||
if (context instanceof WebAppContext)
|
||||
{
|
||||
WebAppContext webapp = (WebAppContext)context;
|
||||
webapp.setParentLoaderPriority(_parentLoaderPriority);
|
||||
if (_defaultsDescriptor != null)
|
||||
webapp.setDefaultsDescriptor(_defaultsDescriptor);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xmlc.getIdMap().put("Server", getDeploymentManager().getServer());
|
||||
xmlc.getProperties().put("jetty.webapp",file.getCanonicalPath());
|
||||
xmlc.getProperties().put("jetty.webapps",file.getParentFile().getCanonicalPath());
|
||||
|
||||
|
@ -295,8 +310,8 @@ public class WebAppProvider extends ScanningAppProvider
|
|||
}
|
||||
|
||||
// Start building the webapplication
|
||||
WebAppContext wah = new WebAppContext();
|
||||
wah.setDisplayName(context);
|
||||
WebAppContext webAppContext = new WebAppContext();
|
||||
webAppContext.setDisplayName(context);
|
||||
|
||||
// special case of archive (or dir) named "root" is / context
|
||||
if (context.equalsIgnoreCase("root"))
|
||||
|
@ -307,7 +322,7 @@ public class WebAppProvider extends ScanningAppProvider
|
|||
{
|
||||
int dash=context.toLowerCase(Locale.ENGLISH).indexOf('-');
|
||||
String virtual = context.substring(dash+1);
|
||||
wah.setVirtualHosts(new String[]{virtual});
|
||||
webAppContext.setVirtualHosts(new String[]{virtual});
|
||||
context = URIUtil.SLASH;
|
||||
}
|
||||
|
||||
|
@ -318,17 +333,17 @@ public class WebAppProvider extends ScanningAppProvider
|
|||
}
|
||||
|
||||
|
||||
wah.setContextPath(context);
|
||||
wah.setWar(file.getAbsolutePath());
|
||||
webAppContext.setContextPath(context);
|
||||
webAppContext.setWar(file.getAbsolutePath());
|
||||
if (_defaultsDescriptor != null)
|
||||
{
|
||||
wah.setDefaultsDescriptor(_defaultsDescriptor);
|
||||
webAppContext.setDefaultsDescriptor(_defaultsDescriptor);
|
||||
}
|
||||
wah.setExtractWAR(_extractWars);
|
||||
wah.setParentLoaderPriority(_parentLoaderPriority);
|
||||
webAppContext.setExtractWAR(_extractWars);
|
||||
webAppContext.setParentLoaderPriority(_parentLoaderPriority);
|
||||
if (_configurationClasses != null)
|
||||
{
|
||||
wah.setConfigurationClasses(_configurationClasses);
|
||||
webAppContext.setConfigurationClasses(_configurationClasses);
|
||||
}
|
||||
|
||||
if (_tempDirectory != null)
|
||||
|
@ -340,9 +355,9 @@ public class WebAppProvider extends ScanningAppProvider
|
|||
* If we used .setTempDirectory(File) all webapps will wind up in the
|
||||
* same temp / work directory, overwriting each others work.
|
||||
*/
|
||||
wah.setAttribute(WebAppContext.BASETEMPDIR,_tempDirectory);
|
||||
webAppContext.setAttribute(WebAppContext.BASETEMPDIR, _tempDirectory);
|
||||
}
|
||||
return wah;
|
||||
return webAppContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue