请教关于重复提交问题
为避免重复提交 使用 struts的 token
为什么System.out.println(this.isTokenValid(request));
打印出来的是 false呢??
public class CeshiToken extends DispatchAction { public ActionForward shezhiToken(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { this.saveToken(request); System.out.println("设置token============================"); //为什么这一行打印出来的是false ????? System.out.println(this.isTokenValid(request)+"~~~~~~~~~~~~~~~~~~~~~"); return mapping.findForward("shezhiToken"); } public ActionForward zhixingFangfa(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println(this.isTokenValid(request)); if(this.isTokenValid(request,true)){ System.out.println("=============执行方法了=============="); this.resetToken(request); } System.out.println("返回去了"); return mapping.findForward("chonghuiyemian"); }}