【发布时间】:2015-01-16 15:59:41
【问题描述】:
@RequestMapping(value = "downloadFIReport.do", method = RequestMethod.POST)
public @ResponseBody String downloadFIBill(ModelMap model,@ModelAttribute("SpringWeb") FIReportSearchInput fiReportSearchInput)
{
//
}
以上是我的控制器代码。我想发送FIReportSearchInput fiReportSearchInput 作为输入而不使用<form:form/> 标记和使用jQuery 的Ajax 方法将其绑定到页面
$.ajax()
如何做到这一点?
这里更新的是FIReportSearchInput的定义
public class FIReportSearchInput {
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date startDate;
@DateTimeFormat(pattern = "dd/MM/yyyy")
private Date endDate;
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
}
【问题讨论】:
-
这个 FIReportSearchInput 对象不是来自视图(JSP)吗??
标签: java jquery spring spring-mvc