The general solution to the continuous repetition of the submission of the following methods.
Method A, commit after the submit button is disabled (most people do this)
Method II, the use of Session, the second part of the token, set a value for the first time, after the request to the first and this token to compare;
Method three, data processing success immediately redirect to another page
Liferay in the foreground uses the client script (may be jquery, did not study carefully), the session, the backstage uses the synchronization, the multithreading and so on solves this question. Service-side solutions to the specific ideas are as follows:
A Doubleclickcontrolor instance is placed in the session, and the instance is synchronized to determine whether the request is repeated.
If you repeat the request, then determine which is the firstrequest, which is not, not the Doubleclickcontrolor instance as the synchronization basis, into a waiting state, until firstrequest execution, call the Notifyall method, Activates the second request.
In Doubleclickfilter, Controller.control (Httpreq, Httpres, chain); the second request will not end with any exceptions, which will execute OK = true; In turn, the console prints out information such as blocking a repeat submission.
In addition, the revision of a filterchain knowledge point.
When a request is made to the server, the filter mapping configuration is used to match which filter needs to be executed before accessing the requested resource. All of the filter forms a filterchain according to the order defined by Filter-mapping, which is called sequentially.
This call is somewhat similar to recursion, and when invoked to Chain.dofilter (), the program execution thread jumps to the next filter's Dofilter method until the last filter, The last filter executes chain.dofilter without performing an action, and does not jump to other filter Executes the code after the Chain.dofilter, exits the Dofilter method, and executes the code following the chain.dofilter of the penultimate filter, and so on.
In Liferay, you set which filter to turn on or off by System.properties.