|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2012 the original author or authors. |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -20,7 +20,7 @@ import javax.servlet.ServletContext; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.core.env.EnumerablePropertySource; |
|
|
|
import org.springframework.core.env.EnumerablePropertySource; |
|
|
|
import org.springframework.core.env.PropertySource; |
|
|
|
import org.springframework.core.env.PropertySource; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* {@link PropertySource} that reads init parameters from a {@link ServletContext} object. |
|
|
|
* {@link PropertySource} that reads init parameters from a {@link ServletContext} object. |
|
|
|
@ -37,12 +37,12 @@ public class ServletContextPropertySource extends EnumerablePropertySource<Servl |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String[] getPropertyNames() { |
|
|
|
public String[] getPropertyNames() { |
|
|
|
return CollectionUtils.toArray( |
|
|
|
return StringUtils.toStringArray(this.source.getInitParameterNames()); |
|
|
|
this.source.getInitParameterNames(), EMPTY_NAMES_ARRAY); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getProperty(String name) { |
|
|
|
public String getProperty(String name) { |
|
|
|
return this.source.getInitParameter(name); |
|
|
|
return this.source.getInitParameter(name); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|