mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-2883 StrutsXmlConfigurationProvider generics fix
- applied patch submitted by Mathias Bogaert git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@747073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -91,11 +91,10 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
@Override
|
||||
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
|
||||
if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
|
||||
containerBuilder.factory(ServletContext.class, new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
containerBuilder.factory(ServletContext.class, new Factory<ServletContext>() {
|
||||
public ServletContext create(Context context) throws Exception {
|
||||
return servletContext;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
super.register(containerBuilder, props);
|
||||
@@ -148,7 +147,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
}
|
||||
if (file.exists()) {
|
||||
try {
|
||||
url = file.toURL();
|
||||
url = file.toURI().toURL();
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IOException("Unable to convert "+file+" to a URL");
|
||||
}
|
||||
@@ -173,6 +172,4 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
public String toString() {
|
||||
return ("Struts XML configuration provider ("+filename+")");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user