Announcement Announcement Module
Collapse
No announcement yet.
Minor improvement to FilterToBeanProxy Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Minor improvement to FilterToBeanProxy

    I'd like to suggest a small improvement to FilterToBeanProxy that would help make my configuration easier and terser.

    Currently you must supply an init param for the name or class of bean to be proxied.

    If no init-param is specified, why not use the name of the filter as a default?

    eg. in web.xml

    Code:
      <filter>
        <filter-name>someBean</filter-name>
        <filter-class>....BeanProxyFilter</filter-class>
      </filter>
    in applicationContext.xml

    Code:
    <bean id="someBean" class="...SomeFilterClass">
    By the way, FilterToBeanProxy is tremendously useful and I use it for many things other than Acegi. Any plans to move it to the Spring Core/Web?

    -Dave

  • #2
    If you contribute a patch, sure, we'll add it.

    However, in CVS (and from 0.8.0) there's a far more powerful FilterChainProxy class. You'll thus only have one FilterToBeanProxy - which loads the FilterChainProxy - and it takes care of the rest.

    Here's an example of the syntax this new filter offers:

    Code:
    <bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy">
     <property name="filterInvocationDefinitionSource">
       <value>
         CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
         PATTERN_TYPE_APACHE_ANT
         /webServices/**=basicProcessingFilter,httpSessionIntegrationFilter,securityEnforcementFilter
         /**=authenticationProcessingFilter,httpSessionIntegrationFilter,securityEnforcementFilter
       </value>
     </property>
    </bean>

    Comment

    Working...
    X