避免重复提交Struts 2 jsp页面

eda*_*lij 7 html java html5 jsp struts2

大家好我有一些jsp页面,我使用struts2来处理我的表单.在用户提交表单后,地址栏中显示的URL将变为somthing.action,因此当用户刷新页面时,表单将再次提交.我怎么处理这个?提交表格后.

Ale*_*r M 4

如果目标是防止重复提交表单,则使用token拦截器http://struts.apache.org/2.x/docs/token-interceptor.htmltokenSession拦截器http://struts.apache.org/2.x/ docs/token-session-interceptor.html

如果您只是想在提交后刷新页面而不再次提交,则重定向到仅显示结果而不是表单的操作。redirectAction为此使用结果。