Report 400: data type mismatch:
The type of time passed in the path URL is string
You can add this annotation in the controller layer to convert string to java.util.date
@DateTimeFormat(pattern = "yyyy-MM-dd") Date begin
@GetMapping
public List<Demand> listAll(@RequestParam("begin") @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam("end") @DateTimeFormat(pattern = "yyyy-MM-dd")Date endTime){
System.out.println("beginTime"+beginTime);
System.out.println("endTime:"+endTime);
return demandClient.queryAllDemands(beginTime, endTime);
}
date begintime in the figure; If the front-end parameter is not begintime but begin, it needs to be defined as begin. font> in @ requestparam
Read More:
- No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.la
- java.lang.NoSuchMethodError: org.json.JSONObject.put(Java/lang/String; Java/util/Collection;) “209151;”
- [Solved] Flowable Start Error: ClassCastException: java.time.LocalDateTime cannot be cast to java.lang.String
- After introducing sass into Vue project, start to report error typeerror [err]_ INVALID_ ARG_ Type]: the “path” argument must be of type string
- build.gradle Warming: cannot be applied to ‘(groovy.lang.Closure)’/'(java.lang.String)’
- 1、 Java 8 date and local date
- Error: (22,57) Java: type parameter… Mapper is not in the range of type variable M
- Error in idea compilation: java.lang.OutOfMemoryError Java heap space and java.lang.StackOverflowError
- How to use scanner to accept char type characters in Java
- Java uses the same event listener for the same type of component
- Error type referred to is not an annotation type:RedisCache
- How to get the current time in java time string
- Solve the problem of testing redis cluster“ java.lang.NumberFormatException : For input string: “ [email protected]@17002 “And so on
- java.text.ParseException: Unparseable date: “2021-06-24“
- Error: java.lang.IllegalArgumentExcept :Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required
- java.util.Collections.max() [How to Use]
- Mybatis error,There is no getter for property named ‘xx’ in ‘class java.lang.String The solution
- Java gets the type t.class of generic t
- TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::HistoryManagerImpl@f22eee1
- ‘Conversion failed when converting date and/or time from character string.DB-Lib error message 241,