Package org.springframework.web.bind

Examples of org.springframework.web.bind.ServletRequestDataBinder


            HandlerExecutionChain handlerExecutionChain = (HandlerExecutionChain) object;
            object = handlerExecutionChain.getHandler();
        }

        if (object != null) {
            ServletRequestDataBinder binder = new ServletRequestDataBinder(object, "request");
            try {
                binder.bind(request);
                binder.setIgnoreUnknownFields(true);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Bound POJO is now: " + object);
                }
            }
            catch (Exception e) {
View Full Code Here


              throw new UnsupportedOperationException("Possible CSRF attack");
            }
          }
         
         
            ServletRequestDataBinder binder = new ServletRequestDataBinder(object, "request");
            try {
                binder.bind(request);
                binder.setIgnoreUnknownFields(true);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Bound POJO is now: " + object);
                }
            }
            catch (Exception e) {
View Full Code Here

     * Binds properties from the request parameters to the given POJO which is
     * useful for POJOs which are configurable via request parameters such as
     * for query/view POJOs
     */
    protected Object bindRequestBean(Object bean, ServletRequest request) {
        ServletRequestDataBinder binder = new ServletRequestDataBinder(bean, null);
        binder.bind(request);
        return bean;
    }
View Full Code Here

              throw new UnsupportedOperationException("Possible CSRF attack");
            }
          }
         
         
            ServletRequestDataBinder binder = new ServletRequestDataBinder(object, "request");
            try {
                binder.bind(request);
                binder.setIgnoreUnknownFields(true);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Bound POJO is now: " + object);
                }
            }
            catch (Exception e) {
View Full Code Here

        if (object instanceof String) {
            String handlerName = (String) object;
            object = getApplicationContext().getBean(handlerName);
        }

        ServletRequestDataBinder binder = new ServletRequestDataBinder(object, "request");
        binder.bind(request);
        binder.setIgnoreUnknownFields(true);
        if (log.isDebugEnabled()) {
            log.debug("Bound POJO is now: " + object);
        }
        return object;
    }
View Full Code Here

  public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
      throws Exception {

    ThrowawayController throwaway = (ThrowawayController) handler;

    ServletRequestDataBinder binder = createBinder(request, throwaway);
    binder.bind(request);
    binder.closeNoCatch();

    return throwaway.execute();
  }
View Full Code Here

   * @see #getCommandName
   */
  protected ServletRequestDataBinder createBinder(HttpServletRequest request, ThrowawayController command)
      throws Exception {

    ServletRequestDataBinder binder = new ServletRequestDataBinder(command, getCommandName());
    initBinder(request, binder);
    return binder;
  }
View Full Code Here

   * @throws Exception in case of invalid state or arguments
   */
  protected final ServletRequestDataBinder bindAndValidate(HttpServletRequest request, Object command)
      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

   * @see #initBinder
   */
  protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object command)
      throws Exception {

    ServletRequestDataBinder binder = new ServletRequestDataBinder(command, getCommandName());
    prepareBinder(binder);
    initBinder(request, binder);
    return binder;
  }
View Full Code Here

   * @param command command object, that must be a JavaBean
   * @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 (int i = 0; i < this.validators.length; i++) {
        if (this.validators[i].supports(command.getClass())) {
          ValidationUtils.invokeValidator(this.validators[i], command, binder.getBindingResult());
        }
      }
    }
    binder.closeNoCatch();
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.bind.ServletRequestDataBinder

Copyright © 2018 www.massapicom. 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.