Spring MVC< form:errors/>标签找不到错误消息 [英] Spring MVC <form:errors/> tag doesn't find error messages

查看:111
本文介绍了Spring MVC< form:errors/>标签找不到错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与编写JSP文件的前端开发人员一起工作.我们有一个可以正常工作的表单,除了似乎无法在Spring的<form:errors/>标记中显示验证/绑定/处理错误之外.

I work with a front-end developer who writes JSP files. We have a form that is working correctly, except validation/binding/processing errors can't seem to be displayed with Spring's <form:errors/> tag.

我已经确认正在设置错误,并且显然是错误的正确路径.假定<form:errors path="*" />应该呈现所有路径,而不管路径如何,但是它什么也没显示.

I've confirmed that the error is being set, and what is apparently the correct path for the errors. Supposedly <form:errors path="*" /> should render them all, regardless of path, but it shows nothing.

我需要进入标签库源代码来推断出什么问题吗?

Do I need to get into the tag library source to deduce what's going wrong?

推荐答案

简单答案:< form:errors/>必须位于< form:form/>元素内才能绑定到模型的"command"对象

Simple answer: <form:errors/> must be within a <form:form/> element in order to bind to the model's "command" object.

这篇关于Spring MVC&lt; form:errors/&gt;标签找不到错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆