
org.openl.spring.env.ServletContextPropertySource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.openl.spring Show documentation
Show all versions of org.openl.spring Show documentation
Common components for Spring integration
The newest version!
package org.openl.spring.env;
import java.util.Collections;
import jakarta.servlet.ServletContext;
import org.springframework.core.env.EnumerablePropertySource;
import org.openl.util.StringUtils;
public class ServletContextPropertySource extends EnumerablePropertySource {
public ServletContextPropertySource(String name, ServletContext servletContext) {
super(name, servletContext);
ConfigLog.LOG.info("Loading ServletContext init parameters: {} properties.", getPropertyNames().length);
}
@Override
public String[] getPropertyNames() {
return Collections.list(source.getInitParameterNames()).toArray(StringUtils.EMPTY_STRING_ARRAY);
}
@Override
public String getProperty(String name) {
return this.source.getInitParameter(name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy