GeeCON Prague 2014*
The moose likes Other Application Frameworks and the fly likes Stripes: ForwardResolution between two ActionBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Stripes: ForwardResolution between two ActionBeans" Watch "Stripes: ForwardResolution between two ActionBeans" New topic
Author

Stripes: ForwardResolution between two ActionBeans

Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Ciao a tutti,

I'm using Stripes to develop a web application (it's a personal, but useful, project just to learn the framework).
Actually I have two ActionBeans that are located in two different packages and I need to forward the resolution of the first ActionBean (step1) directly to the second one (step2).
Is it possible? The problem is that if I specify the full path in the ForwardResolution constructor (i.e. it.overzero.project.package2.actionbean2) it is appended to the path of the first invoked ActionBean, so my application tries to find the second ActionBean at it.overzero.project.package1.actionbean1.it.overzero.project.package2.actionbean2
and this is obviously wrong.
What is the correct logic to follow to do this?

Thanks,
Gabriele Fabbri


OverZero Software
[url]www.overzero.it[/url]
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Ok, I just solved the problem in this way:

The fist actionbean is in the package it.overzero.prj
The second actionbean is in the package it.overzero.prj.pkg

At this point, in the ForwardResolution constructor of the first actionbean I wrote: new ForwardResolution("../MySecondStep.action") and it works.

But I still have the doubt that this is not the proper way to proceed.
Could you tell me if I'm going in the correct direction?
Aaron Porter
Greenhorn

Joined: Feb 26, 2007
Posts: 13
The most reliable way to forward between ActionBeans is to use the class instead of a string:

new ForwardResolution(MySecondStep.class)

Then if you do any refactoring or change the UrlBinding it is automatically handled for you. You won't have to go back and update strings.
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Thank you very much Aaron, you are right.
It's clear now!

Gabriele
 
GeeCON Prague 2014
 
subject: Stripes: ForwardResolution between two ActionBeans