• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ActionForward and Forward Action

 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whats the difference between ActionForward and ForwardAction ? When do we use ActionForward and when ForwardAction.
Can i say ActionForward is a shorter way of doing the same thing ?
Thanks.
 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
refer this and this

Quote from ForwardAction class

An Action that forwards to the context-relative URI specified by the parameter property of our associated ActionMapping. This can be used to integrate Struts with other business logic components that are implemented as servlets (or JSP pages), but still take advantage of the Struts controller servlet's functionality (such as processing of form beans).

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know when do we go for ActionForward class and when do we go for ForwardAction. ForwardAction is a StandardAction class in Struts whereas ActioForward is similar to RequestDispatcher ?

Was just wondering why execute has a return type of ForwardAction rather than ActionForward..

Thanks.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jose chiramal wrote: ActioForward is similar to RequestDispatcher ?


No, ActionForward is the decision taken by the RequestDispatcher in order to forward to next resource.

jose chiramal wrote:Was just wondering why execute has a return type of ForwardAction rather than ActionForward..


Do you want to say opposite of it ?
 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry , my mistake should have been "Was just wondering why execute has a return type of ActionForward rather than ForwardAction.."
I find the both very confusing
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, they are confusing, but to make it simple, remember:
1. ActionForward: One which is a return type of Action#execute() method and used by RequestDispatcher.
2. ForwardAction: Dummy (not exactly) action which can be used to delegate to the servlet or any other business logic implementer which can utilize the Struts other functionality, like ActionForm.
 
reply
    Bookmark Topic Watch Topic
  • New Topic