09-09-2010 06:22 AM
09-09-2010 08:32 AM
09-09-2010 10:05 AM
09-10-2010 04:44 AM
@Override
public void init(FilterConfig conf) throws ServletException {
String propsLocation = conf.getInitParameter( "mappingFileLocation" );
if (propsLocation == null)
{
log.warn( "No filter init parameter 'mappingFileLocation' set (should refer to file in classpath)" );
propsLocation = "themefilter.properties";
}
props = new Properties();
try
{
URL url = Thread.currentThread().getContextClassLoader()
.getResource( propsLocation );
if (url != null)
{
props.load( url.openStream() );
}
else
{
log.warn( "Filter file " + propsLocation
+ " couldn't be read in classpath" );
}
log.debug( "Successfully read site to theme properties file from "
+ propsLocation + " in classpath" );
}
catch (Exception e)
{
log.warn( "Failed to read theme properties from "
+ propsLocation
+ " (mappingFileLocation filter init parameter) in classpath." );
}
}
<filter>
<description>Add theme parameter to requests</description>
<filter-name>ThemeFilter</filter-name>
<filter-class>fr.intuitiv.module.fds.filter.ThemeFilter</filter-class>
<init-param>
<description>Location of mapping file from sites to themes</description>
<param-name>mappingFileLocation</param-name>
<param-value>themefilter.properties</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ThemeFilter</filter-name>
<url-pattern>/page/site/*</url-pattern>
</filter-mapping>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.