Package org.springframework.web.bind

Examples of org.springframework.web.bind.ServletRequestDataBinder.bind()


    }

    @Override
    protected void doBind(WebDataBinder binder, NativeWebRequest webRequest) throws Exception {
      ServletRequestDataBinder servletBinder = (ServletRequestDataBinder) binder;
      servletBinder.bind((ServletRequest) webRequest.getNativeRequest());
    }

    @Override
    protected HttpInputMessage createHttpInputMessage(NativeWebRequest webRequest) throws Exception {
      HttpServletRequest servletRequest = (HttpServletRequest) webRequest.getNativeRequest();
View Full Code Here


   * @throws Exception in case of invalid state or arguments
   */
  protected void bind(HttpServletRequest request, Object command) throws Exception {
    logger.debug("Binding request parameters onto MultiActionController command");
    ServletRequestDataBinder binder = createBinder(request, command);
    binder.bind(request);
    if (this.validators != null) {
      for (Validator validator : this.validators) {
        if (validator.supports(command.getClass())) {
          ValidationUtils.invokeValidator(validator, command, binder.getBindingResult());
        }
View Full Code Here

      throws Exception {

    ServletRequestDataBinder binder = createBinder(request, command);
    BindException errors = new BindException(binder.getBindingResult());
    if (!suppressBinding(request)) {
      binder.bind(request);
      onBind(request, command, errors);
      if (this.validators != null && isValidateOnBinding() && !suppressValidation(request, command, errors)) {
        for (int i = 0; i < this.validators.length; i++) {
          ValidationUtils.invokeValidator(this.validators[i], command, errors);
        }
View Full Code Here

    @Override
    protected void doBind(NativeWebRequest webRequest, WebDataBinder binder, boolean failOnErrors)
        throws Exception {

      ServletRequestDataBinder servletBinder = (ServletRequestDataBinder) binder;
      servletBinder.bind((ServletRequest) webRequest.getNativeRequest());
      if (failOnErrors) {
        servletBinder.closeNoCatch();
      }
    }
View Full Code Here

    }

    @Override
    protected void doBind(WebDataBinder binder, NativeWebRequest webRequest) throws Exception {
      ServletRequestDataBinder servletBinder = (ServletRequestDataBinder) binder;
      servletBinder.bind(webRequest.getNativeRequest(ServletRequest.class));
    }

    @Override
    protected HttpInputMessage createHttpInputMessage(NativeWebRequest webRequest) throws Exception {
      HttpServletRequest servletRequest = webRequest.getNativeRequest(HttpServletRequest.class);
View Full Code Here

  // 绑定参数
  private void bindRequestParameters(WebDataBinder binder, NativeWebRequest request) {
    ServletRequest servletRequest = request.getNativeRequest(ServletRequest.class);
    ServletRequestDataBinder servletBinder = (ServletRequestDataBinder) binder;
    servletBinder.bind(servletRequest);
  }

  // 判断是否需要jsr303认证
  private void validateIfApplicable(WebDataBinder binder, MethodParameter parameter) {
    Annotation[] annotations = parameter.getParameterAnnotations();
View Full Code Here

    ServletRequestDataBinder binder = new ServletRequestDataBinder(rewardForm, "rewardForm");
    // enforces these fields are present in the form
    binder.setRequiredFields(new String[] { "creditCardNumber", "amount", "merchantNumber" });
    binder.registerCustomEditor(MonetaryAmount.class, new MonetaryAmountEditor());
    // copies parameters in the request to the reward form
    binder.bind(request);
    if (binder.getBindingResult().hasErrors()) {
      return new ModelAndView("reward/new", binder.getBindingResult().getModel());
    } else {
      Dining dining = rewardForm.createDining();
      RewardConfirmation confirmation = rewardNetwork.rewardAccountFor(dining);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.