Javatpoint Logo

what is struts flow in struts 1.x

By: arvind*** On: Mon Jan 28 12:47:57 IST 2013     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
This question is asked to me in one interviewUp0Down

 
Model : Models in Struts 1 framework are the java bean classes that extends ActionForm class provided in Struts jars. Model classes holds the state of the internal and external system.

View : Views are web components that are shown to the web browser users. In Struts 1, it can be jsp page or any view render technique such as Tiles.

Controller : Controllers are the components that handles are the requests that comes from users and decides which view is to send back to the use as response. In Struts 1 the controller part is handled by ActionServlet class and a subclass of Action class that is developer defined. The controller may interact with the application specific business logic or some code that persists data in database or with an EJB.

The bellow figure shows the work flow of Struts 1 :


Architecture of Struts 1
The following steps shows the work flow of Strust 1 framework :

1. When first time user request comes from the browser, ActionServlet invoked which reads struts-config.xml configuration file and creates configuration objects. struts-config.xml contains information about the FormBeans, that are subclasses of ActionForm, Actions and view that can be send as response to the browser.

2. In the second step ActionServlet instantiate the specified form bean and puts the value of the form attributes, submitted by the browser, to form bean.

3. Then ActionServlet calls the Action class?s execute method, which returns ActionForward instance. ActionForward instance contains the detail of the view to be return as response.

4. ActionServlet renders the view and return to the browser as response.
Image Created0Down

By: [email protected] On: Mon Jan 28 13:30:04 IST 2013 Question Reputation0 Answer Reputation147 Belt Series Points0 147User Image
Are You Satisfied :7Yes10No
 
Image Created0Down

By: [email protected] On: Thu Jun 15 15:25:56 IST 2017 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No