文件名称:struts-ET
介绍说明--下载内容均来自于网络,请自行研究使用
使用Struts的Token机制防止重复提交
Struts的Token(令牌)机制能够很好的解决表单重复提交的问题,基本原理是:
服务器端在处理到达的请求之前,会将请求中包含的令牌值(通过隐藏字段来保存)
与保存在当前用户会话中的令牌值进行比较,看是否匹配。
1、saveToken(request) //Token保存到session某属性中
2、isTokenValid(request) 或使用 2、isTokenValid(request, true),则不需要第三步
//将请求中的Token与session中的Token值进行比较,第二参数表示是否移出session中的保存Token的属性
3、resetToken(request) //移出session中的保存Token的属性-Struts use the Token mechanism in place to prevent duplication of submission of Struts-Token (token) mechanism to form a very good solution to the problem of duplicate submission, the basic principle is: the server-side in the deal before the arrival of the request, the request will be included in the token value (through the hidden field to save) and stored in the current user
Struts的Token(令牌)机制能够很好的解决表单重复提交的问题,基本原理是:
服务器端在处理到达的请求之前,会将请求中包含的令牌值(通过隐藏字段来保存)
与保存在当前用户会话中的令牌值进行比较,看是否匹配。
1、saveToken(request) //Token保存到session某属性中
2、isTokenValid(request) 或使用 2、isTokenValid(request, true),则不需要第三步
//将请求中的Token与session中的Token值进行比较,第二参数表示是否移出session中的保存Token的属性
3、resetToken(request) //移出session中的保存Token的属性-Struts use the Token mechanism in place to prevent duplication of submission of Struts-Token (token) mechanism to form a very good solution to the problem of duplicate submission, the basic principle is: the server-side in the deal before the arrival of the request, the request will be included in the token value (through the hidden field to save) and stored in the current user
相关搜索: isTokenValid
(系统自动生成,下载前可以参看下载内容)
下载文件列表
防重复提交
..........\ET
..........\..\failed.jsp
..........\..\index.jsp
..........\..\success.jsp
..........\..\upload
..........\..\......\JSP入门与提高.rar
..........\..\......\sample789.doc
..........\..\......\学习struts的好资料struts.zip
..........\..\upload.jsp
..........\..\WEB-INF
..........\..\.......\classes
..........\..\.......\.......\resources
..........\..\.......\.......\.........\application.properties
..........\..\.......\.......\Token.java
..........\..\.......\.......\UploadAction.java
..........\..\.......\.......\UploadForm.java
..........\..\.......\.......\yuyf
..........\..\.......\.......\....\Token.class
..........\..\.......\.......\....\UploadAction.class
..........\..\.......\.......\....\UploadForm.class
..........\..\.......\lib
..........\..\.......\...\commons-beanutils.jar
..........\..\.......\...\commons-collections.jar
..........\..\.......\...\commons-digester.jar
..........\..\.......\...\commons-fileupload.jar
..........\..\.......\...\commons-lang.jar
..........\..\.......\...\commons-logging.jar
..........\..\.......\...\commons-validator.jar
..........\..\.......\...\jakarta-oro.jar
..........\..\.......\...\struts.jar
..........\..\.......\struts-bean.tld
..........\..\.......\struts-config.xml
..........\..\.......\struts-html.tld
..........\..\.......\struts-logic.tld
..........\..\.......\struts-nested.tld
..........\..\.......\struts-template.tld
..........\..\.......\struts-tiles.tld
..........\..\.......\tiles-defs.xml
..........\..\.......\validation.xml
..........\..\.......\validator-rules.xml
..........\..\.......\web.xml
..........\说明2.txt
..........\ET
..........\..\failed.jsp
..........\..\index.jsp
..........\..\success.jsp
..........\..\upload
..........\..\......\JSP入门与提高.rar
..........\..\......\sample789.doc
..........\..\......\学习struts的好资料struts.zip
..........\..\upload.jsp
..........\..\WEB-INF
..........\..\.......\classes
..........\..\.......\.......\resources
..........\..\.......\.......\.........\application.properties
..........\..\.......\.......\Token.java
..........\..\.......\.......\UploadAction.java
..........\..\.......\.......\UploadForm.java
..........\..\.......\.......\yuyf
..........\..\.......\.......\....\Token.class
..........\..\.......\.......\....\UploadAction.class
..........\..\.......\.......\....\UploadForm.class
..........\..\.......\lib
..........\..\.......\...\commons-beanutils.jar
..........\..\.......\...\commons-collections.jar
..........\..\.......\...\commons-digester.jar
..........\..\.......\...\commons-fileupload.jar
..........\..\.......\...\commons-lang.jar
..........\..\.......\...\commons-logging.jar
..........\..\.......\...\commons-validator.jar
..........\..\.......\...\jakarta-oro.jar
..........\..\.......\...\struts.jar
..........\..\.......\struts-bean.tld
..........\..\.......\struts-config.xml
..........\..\.......\struts-html.tld
..........\..\.......\struts-logic.tld
..........\..\.......\struts-nested.tld
..........\..\.......\struts-template.tld
..........\..\.......\struts-tiles.tld
..........\..\.......\tiles-defs.xml
..........\..\.......\validation.xml
..........\..\.......\validator-rules.xml
..........\..\.......\web.xml
..........\说明2.txt