Ad (728x90)

Filled Under: , ,

What is Globalforward and Forward in Struts?

ActionForm Learn Struts Struts 2
A Struts forward is an object that is returned by an action and has two fields: a name and a path. The path indicates where a request is to be forwarded and it is available to all actions.

Difference between Forward and global forward
A forward can be local (for specific action) or global (available to any action).

A forward can be global or local. A global forward is defined in a struts-config.xml file and redirect to a specified JSP page. A local forward is defined in a struts-config.xml file in an action mapping and is invoked when the action is invoked.

Example for Global Forward
<global-forwards>
  <forward   name="logoff"               path="/Applogoff.do"/>
  <forward   name="logon"                path="/Applogon.jsp"/>
  <forward   name="success"              path="/Applogin.jsp"/>
</global-forwards>

Example for Forward
 
<action path="/changePassword" type="com.bhanuapp.app.security.changePassword" attribute="changePassword" scope="request" validate="true">
  <forward name="failure" path="/passwordError.jsp"/> 
       <forward name="success" path="/changePassword.jsp"/>
</action>


Unknown

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment

Please write to us here...

 

We are featured contributor on entrepreneurship for many trusted business sites:

  • Copyright © Tekhnologia™ is a registered trademark.
    Designed by Templateism. Hosted on Blogger Templates.