As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
@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>