Results 1 to 2 of 2

Thread: DataBinder setAllowedFields not working

  1. #1
    Join Date
    May 2008
    Posts
    153

    Default DataBinder setAllowedFields not working

    I can't figure out why attempts to restrict the set of allowed fields which get bound in the controller is not working:

    I have a base controller class which my controllers extend.
    Code:
    public abstract class AbstractMultiActionController extends MultiActionController {
    	protected abstract String [] getAllowedFieldsForBind(HttpServletRequest request);
    
    	protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    		String strings[] = getAllowedFieldsForBind(request);
    		s_logger.debug("set allowed fields: " + strings);
    		binder.setAllowedFields(strings);
    	}
    I see initBinder() being called, however; I don't see the affect, and I don't see any of the trace I would expect from DataBinder.setAllowedFields().

  2. #2
    Join Date
    May 2008
    Posts
    153

    Default Problem Solved

    The problem is that setAllowedFields(new String[] {}) is the SAME AS allowing all fields. The javadoc should really be clearer here.

Posting Permissions

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