This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Query on ForwardAction

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I have a small query Please exlpain in brief.

What is the difference between ForwardAction,Forward attribute and forward tag?
Which one we need to prefer and what conditions we need to use these?

Please explain in brief with small examples.

Thanks,
Krishna
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is a ForwardAction? Please explain.
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ForwardAction is a dummy action (included in struts extras) that does nothing but forward the request to a page defined in the parameter attribute. The forward tag defines a forward for the action. An action can have several forwards to choose from between them. The definition of the forward attribute is below, copied from the DTD documentation

Module-relative path of the servlet or other resource that will process this request, instead of the Action class specified by "type". The path WILL NOT be processed through the "forwardPattern" attribute that is configured on the "controller" element for this module. Exactly one of "forward", "include", or "type" must be specified.


[ May 02, 2008: Message edited by: Alaa Nassef ]
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

What is the difference between a ForwardAction and org.apache.struts.action.ActionForward?
 
Alaa Nassef
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the API documentation

An ActionForward represents a destination to which the controller, RequestProcessor, might be directed to perform a RequestDispatcher.forward or HttpServletResponse.sendRedirect to, as a result of processing activities of an Action class. Instances of this class may be created dynamically as necessary, or configured in association with an ActionMapping instance for named lookup of potentially multiple destinations for a particular mapping instance.



An ActionForward is represented by the forward tag in the struts config, and it's the return of the execute method in the Action class
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic