-
Dec 27th, 2004, 11:37 AM
#1
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
-
Dec 27th, 2004, 11:46 AM
#2
You can add a reqest for this on JIRA.
-
Dec 27th, 2004, 12:00 PM
#3
-
Dec 27th, 2004, 12:56 PM
#4
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
-
Forum Rules