【发布时间】:2017-11-20 21:06:48
【问题描述】:
当我的 ajax 请求运行时,我收到此错误:
WARN DefaultHandlerExceptionResolver:361 - 绑定请求失败 元素: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: 无法将“java.lang.String”类型的值转换为所需类型 'java.lang.Long';嵌套异常是 java.lang.NumberFormatException: 对于输入字符串:“getDateTimeFormat
Ajax 错误:400:Bad Request - /dobi/activity/activityEntry/edit/getDateTimeFormat
我的控制器:
@ResponseBody
@RequestMapping(value = "/getDateTimeFormat")
public Boolean getDateTimeFormat(HttpSession session) {
Boolean status = Boolean.FALSE;
return status;
}
我的 ajax:
$.ajax({
type: "GET",
url: "/dobi/activity/activityEntry/edit/getDateTimeFormat",
cache: true,
success: function (response) {
//do something
}
});
另外,我正在使用 cache: true,因为它在 url 请求中附加了不需要的数据。
【问题讨论】: