Many times to prevent repeated submissions, such as the forum in the issue of questions, if not control that can be submitted ~
How to use: Forum for example
Ask.do: Action for jumping to the question page
Ask.jsp: For the question page
Askok.do: A successful action submitted for questioning
ASKOK.JSP: The JSP that handles the jump after questioning
First of all ask this action to join Savetoken (request), which is to create a hidden form on the question page that is the ask.jsp page
<input type= "hidden" name= "Org.apache.struts.taglib.html.TOKEN" value= "a6b9ff6834284444001b8206723b654d" >
On Ask. The JSP page does the following: Use form for
Form 1.1 does not write name without this attribute but in Struts-config. The XML is configured with this actionform we can define it as question and configure Askok this action to write the corresponding form
<action path= "/askok" type= "..." name= "question" > must write this or you will report a failure to find the form.
If you want to be in ask. JSP this page to do JS processing to use the form name words can be directly written question because struts automatically generated the form after the name generated: <form name= "bangquestion" method= "POST" action= "/askok.do" >
Ask.jsp This page automatically generates add form name
Then write the IF (Istokenvalid (Ac.getrequest (), true) in Askok.do {
Add a question
}else
{
jump prompt
}