Results 1 to 4 of 4

Thread: GenericFilterBean.shouldNotFailOnInvalidProperty

  1. #1
    Join Date
    Aug 2004
    Location
    St. Louis, MO, USA
    Posts
    24

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    You can add a reqest for this on JIRA.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Aug 2004
    Location
    St. Louis, MO, USA
    Posts
    24

  4. #4
    Join Date
    Aug 2004
    Location
    St. Louis, MO, USA
    Posts
    24

    Default

    Fixed. That's awesome. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •