Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stripes: ForwardResolution between two ActionBeans

 
Gabriele Fabbri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gabriele Fabbri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Aaron, you are right.
It's clear now!

Gabriele
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic