aspose file tools*
The moose likes Struts and the fly likes Parameter Interceptor  behaviour in case of Model driven Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Parameter Interceptor  behaviour in case of Model driven Action" Watch "Parameter Interceptor  behaviour in case of Model driven Action" New topic
Author

Parameter Interceptor behaviour in case of Model driven Action

raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
HI,
If i use Model driven action and use model to store the data ,How Parameter Interceptor knows that it should look for setters in the model and not in the Action class?I tried to look into the source code but did n't get , how its working?
Thanks for reading this

Thanks,
Raj
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If an action implements ModelDriven the results of the getModel() call are pushed onto the value stack.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 642
And in case David's response wasn't clear, when the Model is pushed on the Value Stack, it sits above the Action. When both the Model and Action expose the same property, the one in the model will effectively hide the one in the action.
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
Thanks Mark and David, so what i understood is that Interceptor will always call setter on valuestack and for them it does not matter whether it is model or Action itself.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Correct: until the value is found the calls will proceed down the valuestack until there's nothing left to try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parameter Interceptor behaviour in case of Model driven Action
 
Similar Threads
Some questions about the Scoped Model Driven interface of Struts 2
|Solved| - How to configure Global Interceptor?.. (Struts2)
Struts2 ModelDriven Not Threadsafe?
ModelDriver Interceptor + not getting my object
Redirect url with in the action class