List of usage examples for org.springframework.beans.propertyeditors StringTrimmerEditor StringTrimmerEditor
public StringTrimmerEditor(boolean emptyAsNull)
From source file:com.bxf.hradmin.headcount.controller.HeadcountController.java
@InitBinder public void dataBinding(WebDataBinder binder) { binder.registerCustomEditor(String.class, "reason", new StringTrimmerEditor(true)); binder.registerCustomEditor(String.class, "note", new StringTrimmerEditor(true)); }
From source file:com.google.ie.web.controller.AuditController.java
/** * Register custom binders for Spring. Needed to run on app engine * // w ww. j a va 2s . co m * @param binder * @param request */ @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true)); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); binder.registerCustomEditor(Date.class, new CustomDateEditor(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL), true)); }
From source file:org.jtalks.common.web.controller.UserController.java
/** * This method turns the trim binder on. Trim bilder * removes leading and trailing spaces from the submitted fields. * * @param binder Binder object to be injected *//*from w w w .j a va 2 s.c om*/ @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }
From source file:com.springinpractice.ch11.web.controller.AbstractCrudController.java
/** * @param binder binder//from w ww. j a va 2 s . co m */ @InitBinder(MK_FORM_DATA) public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); binder.setAllowedFields(getAllowedFields()); }
From source file:org.ng200.openolympus.controller.admin.AdministrativeChangePasswordController.java
@InitBinder protected void initBinder(final HttpServletRequest request, final ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }
From source file:org.motechproject.server.omod.web.controller.MessagePatientController.java
@InitBinder public void initBinder(WebDataBinder binder) { String datePattern = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); dateFormat.setLenient(false);// www .j av a 2 s. c om binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true, datePattern.length())); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }
From source file:org.motechproject.server.omod.web.controller.SearchPatientsController.java
@InitBinder public void initBinder(WebDataBinder binder) { String datePattern = "dd/MM/yyyy"; SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); dateFormat.setLenient(false);//from ww w . ja v a 2s. c o m binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true, datePattern.length())); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }
From source file:org.tonguetied.web.KeywordSearchController.java
@Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(Language.class, new LanguageSupport(keywordService.getLanguages())); binder.registerCustomEditor(Bundle.class, new BundleSupport(keywordService.getBundles())); binder.registerCustomEditor(Country.class, new CountrySupport(keywordService.getCountries())); binder.registerCustomEditor(TranslationState.class, new TranslationStateSupport()); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }
From source file:org.lareferencia.provider.controller.ProviderController.java
@Override protected void initBinder(final HttpServletRequest request, final ServletRequestDataBinder binder) { binder.registerCustomEditor(String.class, null, new StringTrimmerEditor(true)); }
From source file:org.motechproject.server.omod.web.controller.DemoPatientController.java
@InitBinder public void initBinder(WebDataBinder binder) { String datePattern = "dd/MM/yyyy"; SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); dateFormat.setLenient(false);//from w w w. j ava 2 s. c o m binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true, datePattern.length())); String timePattern = MotechConstants.TIME_FORMAT_DELIVERY_TIME; SimpleDateFormat timeFormat = new SimpleDateFormat(timePattern); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, "timeOfDay", new CustomDateEditor(timeFormat, true, timePattern.length())); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); }