Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts 2 flow

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
//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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic