1:令牌机制的背景及意义
解决重复提交表单问题
利用token拦截器实现
2:实现令牌验证的步骤
第一步:jsp页面加入标签支持<%@ taglib uri=”/struts-tags” prefix=”s” %>
第二步:表单中加入
<s:token></s:token>
第三步:struts.xml中在需要验证重复提交的action中加入验证拦截器
<interceptor-ref name="token" />
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="invalid.token">repeatsubmit.jsp</result>