Saturday, June 23, 2012

Struts2 Architecture+lifecycle

reference:-http://viralpatel.net/blogs/introduction-to-struts-2-framework/


  1. The normal lifecycle of struts begins when the request is sent from client. This results invoke the servlet container which in turn is passed through standard filter chain.
  2. The FilterDispatcher filter is called which consults the ActionMapper to determine whether an Actionshould be invoked.
  3. If ActionMapper finds an Action to be invoked, the FilterDispatcher delegates control to ActionProxy.
  4. ActionProxy reads the configuration file such as struts.xml. ActionProxy creates an instance ofActionInvocation class and delegates the control.
  5. ActionInvocation is responsible for command pattern implementation. It invokes the Interceptors one by one (if required) and then invoke the Action.
  6. Once the Action returns, the ActionInvocation is responsible for looking up the proper result associated with the Action result code mapped in struts.xml.
  7. The Interceptors are executed again in reverse order and the response is returned to the Filter (In most cases to FilterDispatcher). And the result is then sent to the servlet container which in turns send it back to client.
     
    last week i have gone through the struts concepts .thanks to mykong's blog.i am becoming his fan.
    REFERENCE:-http://www.mkyong.com/tutorials/struts-2-tutorials/