我想使用LocalDate
as @QueryParam
,但我收到编译时错误 as
Incorrect parameter type
Inspection info: Checks types of parameters annotated @PathParam, @QueryParam, etc. The type of the annotated parameter, field or property must either:
Be a primitive type.
Have a constructor that accepts a single String argument.
Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String)).
Have a registered implementation of ParamConverterProvider JAX-RS extension SPI that returns a ParamConverter instance capable of a "from string" conversion for the type.
Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2, 3, or 4 above. The resulting collection is read-only.
我在我的资源类中使用如下
@QueryParam("lastLoginStartDate") LocalDate startDate
有什么方法可以在 API 中使用LocalDate
吗javax.ws.rs.QueryParam
?