开发者

Struts2 - Showing validation errors on page

开发者 https://www.devze.com 2023-01-08 00:10 出处:网络
I\'m using simple theme in my struts2 application. In m开发者_开发知识库y action\'s validate() method, if i add validation error messages using addFieldError(fieldName, message), the error message is

I'm using simple theme in my struts2 application. In m开发者_开发知识库y action's validate() method, if i add validation error messages using addFieldError(fieldName, message), the error message is not showing up in my view page. I guess this is because I use the simple theme.

So, how do I show struts2 validation errors in my screen?


Just for the record, there is a typing error in you tag. Correct tag is:

<s:fielderror/>


Got the answer: it's using <s:fieldError/> tag in my JSP file. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消