Package com.fengjing.framework.springmvc.form.handling.model

Examples of com.fengjing.framework.springmvc.form.handling.model.Customer


  @Override
  protected ModelAndView onSubmit(HttpServletRequest request,
    HttpServletResponse response, Object command, BindException errors)
    throws Exception {
    Customer customer = (Customer)command;
    System.out.println(customer);
    return new ModelAndView("CustomerSuccess","customer",customer);
  }
View Full Code Here


  @Override
  protected Object formBackingObject(HttpServletRequest request)
    throws Exception {
    Customer cust = new Customer();
    //Make "Spring MVC" as default checked value
    cust.setFavFramework(new String []{"Spring MVC"});
    //Make "Make" as default radio button selected value
    cust.setSex("M");
    //make "Hibernate" as the default java skills selection
    cust.setJavaSkills("Hibernate");
    //initilize a hidden value
    cust.setSecretValue("I'm hidden value");
    return cust;
  }
View Full Code Here

    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "favNumber",
      "required.favNumber", "Field name is required.");
    ValidationUtils.rejectIfEmptyOrWhitespace(
      errors, "javaSkills", "required.javaSkills","Field name is required.");
    Customer cust = (Customer)target;
    if(!(cust.getPassword().equals(cust.getConfirmPassword()))){
      errors.rejectValue("password", "notmatch.password");
    }
    if(cust.getFavFramework().length==0){
      errors.rejectValue("favFramework", "required.favFrameworks");
    }
    if("NONE".equals(cust.getCountry())){
      errors.rejectValue("country", "required.country");
    }
  }
View Full Code Here

TOP

Related Classes of com.fengjing.framework.springmvc.form.handling.model.Customer

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.