Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Whenever the wait result is returned, the action that is currently running in the background will be placed on top of the stack. This allow allows you to display progress data, such as a count, in the wait page. By making the wait page automatically reload the request to the action (which will be short-circuited by the interceptor), you can give the appearance of an automatic progress meter.

...

Note

Because the action will be running in a seperate thread, you can't use ActionContext because it is a ThreadLocal. This means if you need to access, for example, session data, you need to implement SessionAware rather than calling ActionContext.getSesion().

Extending the Interceptor

If you wish to make special preparations before and/or after the invocation of the background thread, you can extend the BackgroundProcess class and implement the beforeInvocation() and afterInvocation() methods. This may be useful for obtaining and releasing resources that the background process will need to execute successfully. To use your background process extension, extend ExecuteAndWaitInterceptor and implement the getNewBackgroundProcess() method.