Loading
Different kind of Action classes

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  Please tell some of different kind of Action classes available ?


Ans)

The different kinds of actions are done by the following:
Forward Action,Include Action, DispatchAction.

Dispatch Action
The dispatch action is meant to be a workload reducer. It allows you to use
"org.apache.struts.actions.DispatchAction" to combine functions that are related into a single
action instead of having to create a new action for each required function. For example, within
a dispatch action you could include multiple forward actions.

IncludeAction:
<action path="/saveDetail" type="org.apache.struts.actions.IncludeAction"
name="detailForm" scope="request" input="/detail.jsp" parameter="/path to processing servlet">

ForwardAction:
<action path="/saveSubscription" type="org.apache.struts.actions.ForwardAction"
name="subscriptionForm" scope="request" input="/subscription.jsp"
parameter="/path/to/processing/servlet"/>


  public class UserAction extends DispatchAction  {
        public ActionForward add(ActionMapping mapping, ActionForm form,
         HttpServletRequest request, HttpServletResponse response) {
    }
        public ActionForward update(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
        UserForm userForm = (UserForm) form;
        userForm.setMessage("Inside update user method.");
        return mapping.findForward(SUCCESS);
  }
}



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Different kind of Action classes


Different kind of Action classes

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free