사용자 도구

사이트 도구


springframework:mvc:initbinder

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
springframework:mvc:initbinder [2015/07/29 18:03]
kwon37xi
springframework:mvc:initbinder [2015/08/31 17:51] (현재)
kwon37xi
줄 3: 줄 3:
   * 기본적으로 문자열 파라미터가 쉼표로 들어오면 배열이나 List로 넘김   * 기본적으로 문자열 파라미터가 쉼표로 들어오면 배열이나 List로 넘김
   * [[http://stackoverflow.com/questions/4998748/how-to-prevent-parameter-binding-from-interpreting-commas-in-spring-3-0-5|java - How to prevent parameter binding from interpreting commas in Spring 3.0.5?]]<code java>   * [[http://stackoverflow.com/questions/4998748/how-to-prevent-parameter-binding-from-interpreting-commas-in-spring-3-0-5|java - How to prevent parameter binding from interpreting commas in Spring 3.0.5?]]<code java>
-  * @InitBinder+@InitBinder
 public void initBinder(WebDataBinder binder) { public void initBinder(WebDataBinder binder) {
     binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor(null));     binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor(null));
 } }
 </code> </code>
 +
 +===== String empty to null =====
 +  * [[http://stackoverflow.com/questions/2977649/is-there-an-easy-way-to-turn-empty-java-spring-form-input-into-null-strings|Is there an easy way to turn empty Java/Spring form input into null strings?]]
 +  * [[http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/propertyeditors/StringTrimmerEditor.html|StringTrimmerEditor (Spring Framework 4.2.0.RELEASE API)]] 를 사용한다.
 +<code java>
 +@InitBinder
 +public void initBinder(WebDataBinder binder) {
 +    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
 +}
 +</code>
 +
springframework/mvc/initbinder.1438160634.txt.gz · 마지막으로 수정됨: 2015/07/29 18:03 저자 kwon37xi