Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parameter Interceptor behaviour in case of Model driven Action

 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an action implements ModelDriven the results of the getModel() call are pushed onto the value stack.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct: until the value is found the calls will proceed down the valuestack until there's nothing left to try.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic