struts2错误验证

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

在action层的写法:

    this.addActionError("username或password错误");
在jsp页面上取值:

<s:actionerror></s:actionerror>
记得在jsp页面加入�<%@ taglib prefix="s" uri="/struts-tags"%>就能够了



原文地址:https://www.cnblogs.com/hrhguanli/p/3956809.html