Error Description:
After using the
The result is that the date in the text box and the corresponding Java.util.Date type in the form will be quoted argument type mismatch
Abnormal.
Reason:
Actionservlet when a request is received to the page, the Requestutils.populate method is invoked to fill the form.
This method is called to the Beanutils.populate method, which converts different types of values when the method is filled in.
The default actionservlet does not register the corresponding conversion function, which causes the conversion to occur incorrectly
Solution:
Convert date type to string type in 1.ActionForm
The date type is still used in 2.ActionFrom, and a DateConverter class is customized (you need to implement
Converter interface), and then registers the DateConverter in a custom Actionservlet or action base class:
Convertutils.register (New DateConverter (), Date.class).