• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Implement Flash Scope to Struts 2 App

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Many Thanks, Michal.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

What specifically are you having a problem with?
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic