我正在尝试使用从控制器传递的值预填充HTML表单中的某些文本字段。这是代码:
@RequestMapping(value = RECLIAM_FORM_URL, method = RequestMethod.GET)
public ModelAndView renderForm(final HttpServletRequest request) {
ModelAndView mav = new ModelAndView();
ReclaimForm form = new ReclaimForm();
form.setProviderName(request.getParameter("providerName"));
form.setEmailId(request.getParameter("sellerEmail"));
form.setServiceAvailed(request.getParameter("serviceName"));
form.setOrderId(request.getParameter("orderId"));
mav.setViewName(URLConstant.SERVICE_GUARANTEE_FORM);
mav.addObject("reclaimForm", form);
return mav;
}
HTML:
<input type="text" name="providerName" value="${reclaimForm.providerName}">
问题是,无论如何,它都不会提升价值。我甚至尝试过c:out标签,但它似乎没有用。我可能做错了什么?
谢谢!