Spring MVC "The request sent by the client was syntactically incorrect ()" solution.
When using the SpringMVC3 framework to verify the @ DateTimeFormat annotation, an odd error occurs, as long as the date field in the form has an input value, the following error occurs:
This is confusing. Check for a long time, also tried a lot of online said method, for example, some said the lack of joda-time-2.3.jar package reference (later confirmed not this reason ).
The JAVA code snippet is as follows:
@Resourcepublic class Employee {private String id;private String lastName;private int gende;private String email;@DateTimeFormat(pattern="yyyy-MM-dd")private Date birth;private Department department;
The page content is as follows:
LastName:
<%HashMap
gendes = new HashMap
();gendes.put("0","female");gendes.put("1","male");request.setAttribute("gendes", gendes);%>Gender:
Email:
Department:
Birth:
Springmvc. xml configuration contains this Configuration:
From the above, I can't find any problems. Later I wrote a simpler test and found that the Date type Eclipse in JAVA code references java by default. SQL. date class, not the java. util. date. It will be available immediately after correction.
When I found this problem on the internet, I found that many of my friends also encountered this problem. I hope it will help you.