aspose file tools*
The moose likes Struts and the fly likes struts 2 flow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 flow" Watch "struts 2 flow" New topic
Author

struts 2 flow

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

HI Guys,

Can anybody in detail write the steps of struts 2 flow rite from the request comes to web.xml and filter dipatches intercepts the coming request till the end of the result interface and finally the ognl puts the data on to the jsp,
I have done lot of gooling but I want detailed steps this time....in sequence order that how the struts work flow is..??
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Refer the following link http://struts.apache.org/2.0.14/docs/nutshell.html
Just mentioning what are the points missing over there.
All the configuration files will be read at time loading the application.
1)Each and every request passes through filter(StrutsPrepareAndExecuteFilter) for all requests by default. (but you can skip this filter if you have any servlets)
2) StrutsPrepareAndExecuteFilter is responsible for identifying which action to be executed.
3)Once the form data is submitted OGNL takes care the data is available in action class. By calling setter methods in action class.
4)Intercepts is going to execute before action is executed and/or after action execution.

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Mohan Rao Sv wrote:Refer the following link http://struts.apache.org/2.0.14/docs/nutshell.html
Just mentioning what are the points missing over there.
All the configuration files will be read at time loading the application.
1)Each and every request passes through filter(StrutsPrepareAndExecuteFilter) for all requests by default. (but you can skip this filter if you have any servlets)
2) StrutsPrepareAndExecuteFilter is responsible for identifying which action to be executed.
3)Once the form data is submitted OGNL takes care the data is available in action class. By calling setter methods in action class.
4)Intercepts is going to execute before action is executed and/or after action execution.


HI ,

Thanks a lot for the expnation, could you also please specify these steps in detail , like the role of action context & action invocation also..!!
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

//Taken from source of struts
The ActionContext is the context in which an Action is executed. Each context is basically container of objects an action needs for execution like the session, parameters, locale and valueStack etc. ActionContext is implemented using threadLocal so you don't need to worry about making your actions thread safe.

ActionContext is having both ValueStack and ContextMap values.

ValueStack devided into ObjectStack and ContextMap

ObjectStack having objects sending from Action.

Context Map having request, parameters, session, attr, application.

The objects will nullified once the Action execution is done. This is done by making ActionContext = null.

An ActionInvocation represents the execution state of an link Action. It holds the Interceptors and the Action instance. By repeated re-entrant execution of the invoke method, initially by the ActionProxy, then by the Interceptors, the Interceptors are all executed, and then the link Action and the link Result.
 
wood burning stoves
 
subject: struts 2 flow