类 PortletRequestDataBinder

    • 构造器详细资料

      • PortletRequestDataBinder

        public PortletRequestDataBinder​(Object target)
        Create a new PortletRequestDataBinder instance, with default object name.
        参数:
        target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
        另请参阅:
        DataBinder.DEFAULT_OBJECT_NAME
      • PortletRequestDataBinder

        public PortletRequestDataBinder​(Object target,
                                        String objectName)
        Create a new PortletRequestDataBinder instance.
        参数:
        target - the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
        objectName - the name of the target object
    • 方法详细资料

      • bind

        public void bind​(PortletRequest request)
        Bind the parameters of the given request to this binder's target, also binding multipart files in case of a multipart request.

        This call can create field errors, representing basic binding errors like a required field (code "required"), or type mismatch between value and bean property (code "typeMismatch").

        Multipart files are bound via their parameter name, just like normal HTTP parameters: i.e. "uploadedFile" to an "uploadedFile" bean property, invoking a "setUploadedFile" setter method.

        The type of the target property for a multipart file can be MultipartFile, byte[], or String. The latter two receive the contents of the uploaded file; all metadata like original file name, content type, etc are lost in those cases.

        参数:
        request - request with parameters to bind (can be multipart)
        另请参阅:
        MultipartActionRequest, MultipartFile, DataBinder.bind(org.springframework.beans.PropertyValues)