Package org.springframework.beans.propertyeditors

Examples of org.springframework.beans.propertyeditors.StringTrimmerEditor


        setSuccessView(Constant.REDIRECT_INFO_ADMIN_CENTRO);
    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {

        StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
        binder.registerCustomEditor(String.class, trimmerEditor);
    }
View Full Code Here


        setSuccessView(Constant.REDIRECT_WELCOME_USER);
    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {

        StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
        binder.registerCustomEditor(String.class, trimmerEditor);
    }
View Full Code Here

        setSuccessView(Constant.REDIRECT_ELENCO_GRUPPI);
    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {

        StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
        binder.registerCustomEditor(String.class, trimmerEditor);
    }
View Full Code Here

        setCommandClass(Envelope.class);
        setCommandName(Constant.INVIO_MAIL_WIZ);
    }

    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
        StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
        binder.registerCustomEditor(String.class, trimmerEditor);
    }
View Full Code Here

        setCommandName(Constant.SPEDIZIONE);
    }

    public void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {

        StringTrimmerEditor trimmerEditor = new StringTrimmerEditor(false);
        binder.registerCustomEditor(String.class, trimmerEditor);
        DateEditor dateEditor = new DateEditor(new SimpleDateFormat("dd/MM/yyyy"), true);
        binder.registerCustomEditor(Date.class, dateEditor);
    }
View Full Code Here

    GenericBean<String> gb = new GenericBean<String>();
    ArrayList<String[]> list = new ArrayList<String[]>();
    list.add(new String[] {"str1", "str2"});
    gb.setListOfArrays(list);
    BeanWrapper bw = new BeanWrapperImpl(gb);
    bw.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    bw.setPropertyValue("listOfArrays[0][1]", "str3 ");
    assertEquals("str3", bw.getPropertyValue("listOfArrays[0][1]"));
    assertEquals("str3", gb.getListOfArrays().get(0)[1]);
  }
View Full Code Here

  public void testWithSingleValueAndEditor() throws Exception {
    this.bean.setName("Rob Harrop");
    this.tag.setPath("name");
    this.tag.setValue("   Rob Harrop");
    BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
    bindingResult.getPropertyEditorRegistry().registerCustomEditor(String.class, new StringTrimmerEditor(false));
    getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + COMMAND_NAME, bindingResult);

    int result = this.tag.doStartTag();
    assertEquals(Tag.SKIP_BODY, result);
View Full Code Here

public class TheFocusBindingInitializer extends ConfigurableWebBindingInitializer  {
  private static final Logger LOGGER = Logger.getLogger(TheFocusBindingInitializer.class.getName());
 
  public void initBinder(WebDataBinder binder, WebRequest request) {       
    /*Necessary to run into GAE.*/
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor("true", "false", true));
    binder.registerCustomEditor(Long.class, null, new CustomNumberEditor(Long.class, null, true));
        binder.registerCustomEditor(Integer.class, null, new CustomNumberEditor(Integer.class, null, true));
        binder.registerCustomEditor(Float.class, null, new CustomNumberEditor(Float.class, null, true));
        binder.registerCustomEditor(Set.class, "tags", new TagCollectionEditor(Set.class, true));
View Full Code Here

     *
     * @param binder
     */
    @InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
        binder.registerCustomEditor(Boolean.class, new NonNullBooleanEditor());
    }
View Full Code Here

     *
     * @param binder Binder object to be injected
     */
    @InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.propertyeditors.StringTrimmerEditor

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.