---
title: "struts2防止重复提交"
author: "kidd"
date: "2009-02-16T15:52:37Z"
tags: []
slug: "struts2"
draft: false
lastmod: "2009-02-20T17:04:08Z"
id: 333646
url: "https://kidd.iteye.com/blog/333646"
---

JSP代码：下

<html>
	<head>
		<title>会员注册</title>
	</head>
	<body onload="parameter(CERTTYPE)">
		<s:form action="updatepassword.action">
			<s:fielderror></s:fielderror>
			<span style="color:red"><s:token /></span>
			<table>
				<tr><td>帐号：
						<input type="text" name="uname" /></td></tr>
				<tr><td>密码：
						<input type="password" name="passwd" /></td></tr>
			</table>
		</s:form>
	</body>
</html>

struts.xml代码：下

<action name="updatepassword" class="userAction"
			method="updatepassword">
			<result name="input">/updpwd.jsp</result>
			<result name="failure">
				/result.jsp
			</result>
			<result name="success" type="redirect">/result.jsp</result>
			<span style="color:red"><interceptor-ref name="token" />
			<result name="invalid.token" type="dispatcher">
				/WEB-INF/jsp/firstpage.jsp
			</result>
			<interceptor-ref name="defaultStack" /></span>		</action>