Announcement Announcement Module
Collapse
No announcement yet.
GenericFilterBean.shouldNotFailOnInvalidProperty Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GenericFilterBean.shouldNotFailOnInvalidProperty

    I have a Filter that delegates to a spring-managed filter (similar to ACEGI's FilterToBeanProxy). The Filter I am delegating to is a 3rd party filter that requires all initialization parameters be set via the FilterConfig (i.e. no accessor methods exist).

    My Filter (the one that does the delegation) is a subclass of OncePerRequestFilter, and takes advantage of both the once-per-request and should-not-filter features. During initFilterBean, my filter just wants to call the init method of the target filter, passing it getFilterConfig, which means that the parameters required by the target filter are present in the web.xml file. However, the GenericFilterBean will throw exceptions if a property it is attempting to set is not writable on the subclass.

    Would it be possible/proper to add a protected shouldNotFailOnInvalidProperty (or similar) method to the GenericFilterBean that returns false by default? If subclasses overwrite it to return true, then the NotWritablePropertyExceptions would be swallowed. This would allow for cases like mine, where the property is not directly on the subclass, but is meant to be passed along to a target filter.

    Thanks in advance,
    James

  • #2
    You can add a reqest for this on JIRA.

    Comment


    • #3
      Posted.

      http://opensource.atlassian.com/proj...browse/SPR-587

      Comment


      • #4
        Fixed. That's awesome. Thanks.

        Comment

        Working...
        X