当我把表单里面的代码:表单标签上查看cadastro.jsp:春天 - JSP形式:输入上jsp页面错误:jasperexception
<div class="form-group">
<label for="nome" class="col-sm-2 control-label"> name Project: </ label>
<div class="col-sm-10">
<input for="nome" class="form-control" />
<form:errors path="nome" />
</div>
</div>
它的工作原理
但是当我把
<div class="form-group">
<label for="nome" class="col-sm-2 control-label"> Nome do Projeto: </ label>
<div class="col-sm-10">
<form:input cssClass="form-control" path="nome" />
<form:errors path="nome" />
</div>
</div>
不能工作,因为表格:输入标签
错误:
HTTP Status 500 - An exception occurred processing JSP page /WEB-INF/view/cadastro.jsp at line 34
ProjetroController
@RequestMapping(value = "/novoProjeto", method = RequestMethod.POST)
public String adicionarProjeto(@Valid @ModelAttribute("projeto") Projeto projeto, BindingResult result) {
if(result.hasErrors()) {
return("cadastro");
}
projeto.setStatus("NOVO");
this.pc.salvar(projeto);
return "redirect:/listar";
}
它的工作,但你忘了在方法showForm的回报,在案件是:回归“cadastro”当“cadastro”是我的JSP页面的 谢谢你的名字。 –
@ user3602078感谢您指出return语句。 – Rembo