struts2错误验证

时间:2014-04-29 13:18:21   收藏:0   阅读:342

  在登陆的时候一般要用错误验证功能。效果如图:

mamicode.com,码迷

在action层的写法:

    this.addActionError("用户名或密码错误");
在jsp页面上取值:

<s:actionerror></s:actionerror>
记得在jsp页面添加<%@ taglib prefix="s" uri="/struts-tags"%>就可以了



评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!