显示在struts中单独验证actionform数据生成的错误
我正在使用 struts、spring 和 hibernate 开发一个 Web 应用程序。首先要明确一点:代码级别仅限于jdk1.4。 我想验证用户(actionForm)的输入并通过休眠将更新存储到数据库。我现在使用 Struts Validation 框架来验证表单输入的正确性。问题是我希望每个错误消息位于 jsp 中相应输入字段的旁边/下方,而不是由 struts 标签生成,该标签是 .有什么帮助吗? 附:任何其他完成我想要的验证框架也将受到欢迎,因为我还没有实现验证
i am developing a web application using struts, spring and hibernate. One point to be clear first: the code level is limited to jdk1.4.
i want to validate inputs from user (actionForm) and store the updates to database through hibernate. I am now using Struts Validation framework to validate the correctness of the form's inputs. The problems is i want to have each error message located next/below to the corresponding input field in the jsp rather than to generated by struts tag which is a . Any help?
ps. any other validation framework that accomplish what i want would be welcome too, as i have not implement the validation yet
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标签采用 property 属性。如果给出,它仅显示给定属性的错误。只需将此标签与相应的属性放在字段旁边,您就会得到您想要的内容。The
<html:errors>
tag takes a property attribute. If given, it only displays the errors for the given property. Just put this tag with the appropriate property next to the field, and you'll have what you want.