File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Implement Flash Scope to Struts 2 App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Implement Flash Scope to Struts 2 App" Watch "Implement Flash Scope to Struts 2 App" New topic
Author

Implement Flash Scope to Struts 2 App

Mike Cobelmach
Greenhorn

Joined: Jun 17, 2009
Posts: 19
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.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jun 17, 2009
Posts: 19
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
Rancher

Joined: Sep 29, 2008
Posts: 12617

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implement Flash Scope to Struts 2 App
 
Similar Threads
Display:table tag in Struts Application
Apache Struts 2 Web Application Development
Struts 2 in Action
Intended Audiance
which book to refer for struts