Package org.springframework.web.bind

Examples of org.springframework.web.bind.ServletRequestDataBinder


    public void testSetCustomEditorsWithDefaultPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerOne");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
View Full Code Here


   
    public void testSetCustomEditorsWithClassPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerTwo");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
View Full Code Here

   
    public void testSetCustomEditorsWithPropertyPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerThree");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(null, "office"));
    }
View Full Code Here

   
    public void testSetCustomEditorsWithFailure()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerFour");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        try {
            controller.initBinder(new MockHttpServletRequest(), binder);
            this.fail("initBinder should raise an exception!");
        }
View Full Code Here

    public void testSetCustomEditorsWithDefaultPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedAbstractWizardFormController controller = (EnhancedAbstractWizardFormController) this.applicationContext.getBean("testCustomEditorsWizardControllerOne");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
View Full Code Here

   
    public void testSetCustomEditorsWithClassPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedAbstractWizardFormController controller = (EnhancedAbstractWizardFormController) this.applicationContext.getBean("testCustomEditorsWizardControllerTwo");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
View Full Code Here

   
    public void testSetCustomEditorsWithPropertyPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedAbstractWizardFormController controller = (EnhancedAbstractWizardFormController) this.applicationContext.getBean("testCustomEditorsWizardControllerThree");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
        assertNotNull(binder.findCustomEditor(null, "office"));
    }
View Full Code Here

   
    public void testSetCustomEditorsWithFailure()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedAbstractWizardFormController controller = (EnhancedAbstractWizardFormController) this.applicationContext.getBean("testCustomEditorsWizardControllerFour");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        try {
            controller.initBinder(new MockHttpServletRequest(), binder);
            this.fail("initBinder should raise an exception!");
        }
View Full Code Here

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

        ServletRequestDataBinder binder = new ServletRequestDataBinder(object, null);
        binder.bind(request);
        return object;
    }
View Full Code Here

    try {
      taskData = getTaskDataClass().newInstance();
    } catch (Exception e) {
      throw new TaskHandlerException(e.getMessage(),e.getCause());
    }
    ServletRequestDataBinder binder = new ServletRequestDataBinder(taskData);
    binder.setConversionService(conversionService.getObject());
    binder.bind(request);
    try {
      binder.closeNoCatch();
    } catch(Exception e) {
      throw new TaskHandlerException(e.getMessage(),e.getCause());
    }
    return taskData;
  }
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.