我有请求以毫秒为单位发送日期参数:
http://localhost:8090/advanced-search-for-publications?fromPublicationDate=11111111
和bean这样:
public class AdvancedSearchForPublicationsRequest {
private Date fromPublicationDate;
public Date getFromPublicationDate() {
return fromPublicationDate;
}
public void setFromPublicationDate(Date fromPublicationDate) {
this.fromPublicationDate = fromPublicationDate;
}
}
和Controller这样:
@RequestMapping(value = "advanced-search-for-publications", method = RequestMethod.GET)
@ResponseBody
public Response<PublicationsSearchResult> advancedSearchForPublications(AdvancedSearchForPublicationsRequest request) {
System.out.println(request.getFromPublicationDate());
//TODO change it
return null;
}
但程序打印为空。我可以做些什么来使这个映射有效?