I have a use-case where we need to register two instances of a filter with different configuration options. I need to have a "redirectUrl" variable be different for a couple different controller methods that the filter is assigned to. Is it possible to pass options into the filter, or to have the different instances read their configurations from different keys in the application.conf?
In the old version of our java app, we'd register the same filter twice in web.xml with independent configs and then reference them as two different filters in the app.
<filter>
<filter-name>FilterA</filter-name>
<filter-class>filters.AuthFilter</filter-class>
<init-param>
<param-name>LoginURL</param-name>
<param-value>/showcert.aspx</param-value>
</init-param>
<init-param>
<param-name>RedirectURL</param-name>
<param-value>/welcome</param-value>
</init-param>
</filter>
<filter>
<filter-name>FilterB</filter-name>
<filter-class>filters.AuthFilter</filter-class>
<init-param>
<param-name>LoginURL</param-name>
<param-value>/showcert.aspx</param-value>
</init-param>
<init-param>
<param-name>RedirectURL</param-name>
<param-value>/enroll</param-value>
</init-param>
</filter>