File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Probably it's just a simple question (ActionForward?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Probably it Watch "Probably it New topic

Probably it's just a simple question (ActionForward?)

Olexiy Prokhorenko
Ranch Hand

Joined: Jul 11, 2004
Posts: 97
Hello guys,

Please help me a bit.

I need to do the following.

There are a bunch of my Action's (*.do).
They can be called from HTML FORM's, or just via simple href="..." links.

In all of these Action's, they will do some calculations/checkings, and in some cases will redirect to
this "specialaction" will do it's own job, but AFTER that it will need to return to Action which called it, but exactly the way how this previous Action was called (if via HTML FORM - with all data, etc.)

How can I do that?

Thank you!

<a href="" target="_blank" rel="nofollow"></a><br />Free advices and help for entrepreneurs: from Idea to IPO<br />Software and IT Project Management forum
Mark Hartnett

Joined: Mar 01, 2005
Posts: 4
My advice is to not forward to another action object. Just use a basic java class, instanciate it in any action object you need to and use its functions.

You could make the object a singleton so that it is instanciated only once and becomes available for any action object that needs it.

This would eliminate the need to do multiple forwards and allow you to do all your processing in a single action class.
[ March 01, 2005: Message edited by: Mark Hartnett ]
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
ALong with what Mark said, check out the following thread:
Olexiy Prokhorenko
Ranch Hand

Joined: Jul 11, 2004
Posts: 97
Unfortunatelly, I cannot instantiate a class.
This separated Action form can do numerous operations, even presenting few HTML FORMs, and processing their input... and only after that - return to Action which initially called it.

So, it's not an option. Not in my case.
I agree. Here's the link:
subject: Probably it's just a simple question (ActionForward?)
It's not a secret anymore!