I've problem with understanding Flash Scope principle in web application using Struts 2. Can anyone give me short working example of this? I have read book writen by Ian Roughley but there are only three pages about this and in new book writen by Dave Newton is nothing about Flash Scope problem.
That's because it's not really a problem, and usually handled by using the message store interceptor. Using "AUTO" mode solves most people's problems; anything beyond that it can be configured manually in the action configuration, or implemented with a custom interceptor.
For example i have variable numberOfRecords, which indicate number of result on page. I want transfer this variable across more pages.
My first question is In which actions must be getter and setter for these variable? and second How must look struts.xml in basic, working configuration?
I leave the example on Struts pages, but don't understand these formulation
The scope interceptor can be used to pass arbitrary objects from one action ActionA to another other ActionB, provided you have a getter in ActionA and and a similar setter in actionB.
It's not logical - there is written that "pass objects from ActionA ... in ActionA must be getter". I think that must be setter in ActionA because I want here set the value and get it in ActionB - where I would expect getter method.
I am interested in how does it works, description of the principle will be sufficient.
No, to pass from one action to the next the action you're passing *from* must have a getter, so the value can be gotten, and the action you're passing *to* must have a setter, so it can be set on the action.