Both GenericFilterBean and HttpServletBean have a method named addRequiredProperty(String). Their javadoc reads:
Subclasses can invoke this method when and where? I am assuming a subclass must do it in init like this:Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter.
Anywhere else would be too late, and if super.init is not called, none of the parameters will be set into the properties at all. Is this right?Code:public void init(..) { addRequiredProperty("foo"); addRequiredProperty("bar"); super.init(..); }
Whatever the case, the javadocs should be more explicit as to when addRequiredProperty must be called, to avoid confusion with any of the other init* methods.


Reply With Quote