An error occurs when binding form forms of the native basic type. You need to specify a specific type editor. The usage is as follows: first add the method initBinder in BaseAction, and use annotation @ InitBinder to annotate, then spring mvc will first register these editors before binding the form. All the remaining controllers inherit the class. CustomDateEditor spring provides it by yourself. This is the base class BaseAction: [java] public class BaseAction {@ InitBinder protected void initBinder (WebDataBinder binder) {binder. registerCustomEditor (Date. class, new CustomDateEditor (new SimpleDateFormat ("yyyy-MM-dd HH: mm: ss"), true); binder. registerCustomEditor (int. class, new IntegerEditor (); binder. registerCustomEditor (long. class, new LongEditor (); binder. registerCustomEditor (double. class, new DoubleEd Itor (); binder. registerCustomEditor (float. class, new FloatEditor ();} below are various editor classes: Spring provides CustomNumberEditor, or you can skip some editor classes. Use the constructor to construct the Corresponding Editor class. [Java] public class DoubleEditor extends PropertiesEditor {@ Override public void setAsText (String text) throws IllegalArgumentException {if (text = null | text. equals ("") {text = "0";} setValue (Double. parseDouble (text);} @ Override public String getAsText () {return getValue (). toString () ;}} [java] import org. springframework. beans. propertyeditors. propertiesEditor; public class IntegerEditor extends PropertiesEditor {@ Override public void setAsText (String text) throws IllegalArgumentException {if (text = null | text. equals ("") {text = "0";} setValue (Integer. parseInt (text);} @ Override public String getAsText () {return getValue (). toString () ;}} [java] public class LongEditor extends PropertiesEditor {@ Override public void setAsText (String text) throws IllegalArgumentException {if (text = null | text. equals ("") {text = "0";} setValue (Long. parseLong (text);} @ Override public String getAsText () {return getValue (). toString () ;}} [java] public class FloatEditor extends PropertiesEditor {@ Override public void setAsText (String text) throws IllegalArgumentException {if (text = null | text. equals ("") {text = "0";} setValue (Float. parseFloat (text);} @ Override public String getAsText () {return getValue (). toString ();}}