0
在我的Spring应用程序,当我在我的形式提交按钮点击重新加载页面,我敢肯定,我已经忘记了什么东西,但我不能看到错误提交按钮不提交
在JSP ,我创建这样的形式:
<form:form commandName="municipioBean" method="POST">
<label for="df_mun">Estado</label>
<form:select path="df_edo" name="df_edo" id="df_edo"
onchange="getMunicipios();">
<form:option value="0">Seleccione un estado...</form:option>
<form:options items="${listaEstado}" itemValue="codProvincia"
itemLabel="desProvincia" />
</form:select>
<label for="df_mun">Municipio</label>
<form:select path="df_mun" name="df_mun" id="df_mun">
<option selected value="0">Seleccione un estado primero...</option>
</form:select>
<form:hidden id="id_ciudadano" path="id_ciudadano" />
<input type="submit" name="procesar" value="Aceptar" />
</form:form>
而且我的控制器:
@RequestMapping(method = RequestMethod.POST, params = "procesar")
public String procesaSubmit(
@ModelAttribute("municipioBean") MunicipioBean municipioBean,
BindingResult result, HttpServletRequest request, ModelMap model) {
return ConstantesAbre.PASOS_JSP;
}
PARAMS值等于我的名字提交按钮,它的确定太RequestMethod,有什么问题呢? 。
感谢的建议和我的英语不好对不起d:
我不得不为每个路径的方法,因为我需要不同的路径在我的控制器,这样的事情: \t @RequestMapping( “/ municipio.htm”) \t公共字符串的init(ModelMap模型,HttpServletRequest的请求, \t \t \t HttpServletResponse响应){ \t \t return url; \t} 在我的app-servlet中,我有一个标签。 –
尝试添加一个System.out.println语句来查看该方法是否实际上被调用。如果它可能是没有显示在屏幕上的绑定错误。 – blong824
ViewResolver是问题和RequestMapping中的“值”-_- 感谢您的帮助! –