Struts Action Chaining

Struts Action Chaining

Struts Action Chaining?

View Answers

November 20, 2010 at 3:23 PM

The struts-config.xml file is used for action mapping. The action tag has a forward entries. Chaining actions can be done by simply using the proper mapping in your forward entries.

 public class FirstAction extends Action
    {
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
    {
    // Developer Logic
    return mapping.findForward("success");
    }
    }

    /* com/SecondAction.java */
    ...

    public class SecondAction extends Action
    {
    public ActionForward execute(ActionMapping mapping, 
ActionForm form, HttpServletRequest request, 
HttpServletResponse response) throws]

    Exception
    {
    // Another Logic

    return mapping.findForward("success");
    }
    }

    For chaining action of these two action the code of action in struts-config.xml file.

    <action-mappings type="org.apache.struts.action.ActionMapping">
    <action path="/First"
    type="com.FirstAction"
    validate="false">
    <forward name="success" path="/Second.do" />
    </action>
    <action path="/Second"
    type="com.SecondAction"
    scope="session"
    validate="false">
    <forward name="success" path="/Output.jsp" />
    </action>
    </action-mappings>

Thanks.









Related Tutorials/Questions & Answers:
Struts Action Chaining
Struts Action Chaining  Struts Action Chaining
no action mapped for action - Struts
no action mapped for action  Hi, I am new to struts. I followed...: There is no Action mapped for action name HelloWorld
Advertisements
Action Configuration - Struts
Action Configuration  I need a code for struts action configuration in XML
Struts dispatch action - Struts
Struts dispatch action  i am using dispatch action. i send the parameter="addUserAction" as querystring.ex: at this time it working fine. but now my problem is i want to send another value as querystring for example
Struts Action Class
Struts Action Class  What happens if we do not write execute() in Action class
Struts Action Classes
Struts Action Classes  1) Is necessary to create an ActionForm to LookupDispatchAction. If not the program will not executed. 2) What is the beauty of Mapping Dispatch Action
action tag - Struts
action tag  Is possible to add parameters to a struts 2 action tag? And how can I get them in an Action Class. I mean: xx.jsp Thank you
Login Action Class - Struts
Login Action Class  Hi Any one can you please give me example of Struts How Login Action Class Communicate with i-batis
servlet action not available - Struts
servlet action not available  hi i am new to struts and i am.... Struts Blank Application action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml 2 action *.do
Action classes in struts
Action classes in struts  how many type action classes are there in struts   Hi Friend, There are 8 types of Action classes: 1.ForwardAction class 2.DispatchAction class 3.IncludeAction class 4.LookUpDispatchAction
action Servlet - Struts
action Servlet  What is the difference between ActionServlet ans normal servlet? And why actionServlet is required
DTO & Action class - Struts
DTO & Action class  Hi I am really new to struts2. I just wanted to know that if I have a DTO and an action class, how do I put the form data into the DTO? Can someone please explain with a simple example
Dispatch Action - Struts
Dispatch Action  While I am working with Structs Dispatch Action . I am getting the following error. Request does not contain handler parameter named 'function'. This may be caused by whitespace in the label text
autocall for sturts action class - Struts
autocall for sturts action class  Hi All, We are developing a web application with struts frame work. In this project I have to call an action... in the server on action class should run automatically. how can I do this. help me
Struts 2 action-validation.xml not loading
Struts 2 action-validation.xml not loading  Hi All, I am getting... error SERVER : Caught exception while loading file package/action-validation.xml Connection refused: Connect - (unknown location) The path of my action
Struts 2 Action Tag
Struts 2 Action Tag "action" Tag in Struts 2 is used by developer to call... action name. Struts 2 Action Tag is one of the Data Tags, which are used... of Struts 2 Action Tag: (example)ADS_TO_REPLACE_2
jsp to struts 2 action conversion problem - Struts
jsp to struts 2 action conversion problem  i have one jsp page that includes 3 other jsp pages(using RequestDispactcher).how to convert that jsp page to a struts2 action?among that one jsp page is wrritten using jpivot,wct tags
Calling Action on form load - Struts
of an Action with no ActionForm is the LogoffAction in the Struts MailReader...Calling Action on form load  Hi all, is it possible to call... this list is coming from the action which i m calling before the page is being
Is Multiple Actions in Action class - Struts
Is Multiple Actions in Action class  In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple actions.My question is , we can use multiple actions in Action class if(action.equals("add
Servlet action is currently unavailable - Struts
Servlet action is currently unavailable   Hi, i am getting the below error when i run the project so please anyone can help me.. HTTP Status 503 - Servlet action is currently unavailable
I have a doubt regarding action - Struts
I have a doubt regarding action   hi, I have doubt regarding struts,I got response through jsp and once again it redirecting to action..., Please check Action Mapping in the struts-config.xml. If you have any problem
Understanding Struts Action Class
Understanding Struts Action Class       In this lesson I will show you how to use Struts Action..._TO_REPLACE_1 An Action class in the struts application extends Struts
Struts Dispatch Action Example
Struts Dispatch Action Example       Struts Dispatch Action... function. Here in this example you will learn more about Struts Dispatch Action
Struts(1.3) action code for file upload
Struts(1.3) action code for file upload  Hi All, I want to upload... application using HttpUrlConnection. How can i write my struts(1.3) action code... action or let me how the upload request is post to struts action. Thanks  
STRUTS ACTION - AGGREGATING ACTIONS IN STRUTS
STRUTS ACTION - AGGREGATING ACTIONS IN STRUTS... of Action classes for your project. The latest version of struts provides classes... action. In this article we will see how to achieve this. Struts provides four
Servlet chaining
Servlet chaining  What is Servlet chaining
Struts 2 Redirect Action
Struts 2 Redirect Action       In this section, you will get familiar with struts 2 Redirect action and learn to use it in the struts 2 application. Redirect After Post: This post
How to validate a form in action class and forward errors to the jsp in struts?
How to validate a form in action class and forward errors to the jsp in struts?  How to validate a form in action class and forward errors to the jsp in struts
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS - Struts
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS  Hello frnds, I am sending this second time help me out. i need help from u esteemed and talented people.iwould like to write code in struts action class
Forgot Password Action,Struts Forgot Password Action class
Forgot Password Action       Forgot Password Action The password forgot Action is invoked... password action requires user name and passwords same as you had entered during
STRUTS 2 Could not find action or result
STRUTS 2 Could not find action or result  hiii..i am new to struts 2...;package name="Basic" extends="struts-default"> <action name="fetch" class... on my log: WARNING: Could not find action or result There is no Action
http status 404-servlet action is not available - Struts
http status 404-servlet action is not available  hi, i m getting "http status 404-servlet action is not available" in my tomcat5.5 and i m using struts2.0.14 what is the problem pls tell me
Sending large data to Action Class error. Struts code - Struts
Sending large data to Action Class error. Struts code  I have a jsp...);} and in action class i want to get the value of variable 'val'.But since this is large string value so it is not passed to action class. So please help me
linking tree heading in javasript into a Jsp file and then jsp to struts action form
linking tree heading in javasript into a Jsp file and then jsp to struts action form  i have a tree that consists of 3 options say for example 1... javascript tree link to struts action class
Action in Struts 2 Framework
action provides the processing logic for a specific URL with which it is linked. Actions are mostly associated with a HTTP request of User. The action class... action class transfer data from request to the View. It also determines which result
ModuleNotFoundError: No module named 'chaining'
ModuleNotFoundError: No module named 'chaining'  Hi, My Python... 'chaining' How to remove the ModuleNotFoundError: No module named 'chaining... to install padas library. You can install chaining python with following
Struts Forward Action Example
Struts Forward Action Example  ... in the struts-config.xml ADS_TO_REPLACE_2 Create seperate action-mapping , for each... about Struts ForwardAction (org.apache.struts.actions.ForwardAction
need help for writting code in struts action class for check boxes and radio buttons - Struts
need help for writting code in struts action class for check boxes and radio buttons  Hello frnds, i need help from u esteemed and talented people.iwould like to write code in struts action class for check boxes and radio
how to forward select query result to jsp page using struts action class
how to forward select query result to jsp page using struts action class  how to forward select query result to jsp page using struts action class
object chaining? - Hibernate
object chaining?  daoobject.getsession().begainTransaction; can any one explain the code, i am not understanding this line when iam working with swt and hibernate
what is object chaining? - Hibernate
what is object chaining?   daoobject.getsession().begainTransaction; can any one explain the code, i am understanding this line when iam working with swt and hibernate
Chaining of Multiple view resolvers
In this section, you will learn about chaining of multiple view resolvers
STRUTS
STRUTS   1) Difference between Action form and DynaActionForm? 2) How the Client request was mapped to the Action file? Write the code and explain
Struts 2 Interceptors
Struts 2 Interceptors Struts 2 framework relies upon Interceptors to do most of the work before and after an action is executed. Interceptors are by default part of Struts 2 default stack and are executed in a specific order
Introduction to Action interface
Introduction To Struts Action Interface The Action interface contains the a single method execute(). The business logic of the action is executed within... from user. NONE- If the execution of action is successful but you do not want
Understanding jQuery statement chaining
Understanding jQuery statement chaining       Understanding jQuery statement chaining JQuery provide statement chaining which can reduce the length of the code
struts
struts  hi i would like to have a ready example of struts using "action class,DAO,and services" for understanding.so please guide for the same. thanks  Please visit the following link: Struts Tutorials
Actions - Struts
Action struts 2  Please explain the Action Script in Struts
struts
, Richard Hightower 3)Struts in Action By Ted N. Husted, Cedric Dumoulin, George...struts  which is the best book to study struts on own? please tell me   You can learn struts through the following books: 1)Programming
struts
, Richard Hightower 3)Struts in Action By Ted N. Husted, Cedric Dumoulin, George...struts  which is the best book to study struts on own? please tell me   You can learn struts through the following books: 1)Programming

Ads