Struts 2 execAndWait interceptor example
The execAndWait interceptor otherwise called execute and hold up interceptor is utilized to show the middle result.
It is prescribed to use for long running action.
It isn't found in the default stack bydefault. So you have to indicate it explicitely.
If you don't indicate "wait" result, swaggers structure shows a middle of the road result until your solicitation is completed.
For the custom moderate outcome, you have to characterize "pause" result in struts.xml record. In your page, you can show preparing picture and so on. Along these lines, it is smarter to determine the custom result.
Parameters of execAndWait interceptor
There are 3 parameters characterized for execAndWait interceptor.
|delay||determines the underlying defer time. Bydefault, no underlying postponement is set.|
|delaySleepInterval||utilized just with postponement. It determines the time interim in milliseconds to watch that foundation procedure is finished. It is set to 100 milliseconds bydefault.|
|threadPriority||determines the need of the string. The default is Thread.NORM_PRIORITY.|
Example of execAndWait interceptor without hold up result
Let's see the straightforward case of execAndWait interceptor without hold up result. In such case, swaggers structure gives a middle of the road result.
Example of execAndWait interceptor with hold up result
Let's see the basic case of execAndWait interceptor with hold up result. In such case, your middle of the road page is invoked.
Let's compose the code for halfway outcome. The s:url label will advance the solicitation to indicated url.