


package com.ll.model;import java.beans.PropertyEditorSupport;public class PersonEditor extends PropertyEditorSupport {@Overridepublic void setAsText(String text) throws IllegalArgumentException {Person p = new Person();if (text != null) {String[] items = text.split(":");p.setUsername(items[0]+"by propertyeEditor");p.setPasswd(items[1]);p.setRealName(items[2]);p.setPrice(Double.parseDouble(items[3]));}setValue(p);}@Overridepublic String getAsText() {return getValue().toString();}}




【Spring学习笔记-MVC-8.1】SpringMVC之类型转换@initBinder
原文:http://www.cnblogs.com/ssslinppp/p/4599436.html