File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
mapping.findForward("specialaction")
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!
 
Mark Hartnett
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ALong with what Mark said, check out the following thread:

http://www.coderanch.com/t/50284/Struts/Struts-Recipes-Action-chaining-recipe
 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic