We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12
Struts
UNIT-V
By:- Navin Kumar Goyal
Asstt. Professor C.S. Department Suresh Gyan Vihar University, Jaipur What is Struts? Struts Frame work is the implementation of Model-View- Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open source. Struts Framework is suited for the application of any size. What is Model-View-Controller (MVC) Architecture? - Model-View-Controller architecture is all about dividing application components into three different categories Model, View and the Controller. Components of the MVC architecture has unique responsibility and each component is independent of the other component. Changes in one component will have no or less impact on other component. Responsibilities of the components are: - What is Model-View-Controller (MVC) Architecture? - Model: Model is responsible for providing the data from the database and saving the data into the data store. All the business logic are implemented in the Model. Data entered by the user through View are check in the model before saving into the database. Data access, Data validation and the data saving logic are part of Model. - What is Model-View-Controller (MVC) Architecture? - View: View represents the user view of the application and is responsible for taking the input from the user, dispatching the request to the controller and then receiving response from the controller and displaying the result to the user. HTML, JSPs, Custom Tag Libraries and Resources files are the part of view component. - What is Model-View-Controller (MVC) Architecture? - Controller: Controller is intermediary between Model and View. Controller is responsible for receiving the request from client. Once request is received from client it executes the appropriate business logic from the Model and then produce the output to the user using the View component. ActionServlet, Action, ActionForm and struts- config.xml are the part of Controller. – Installing Struts Application Download latest version of Struts from the official site of Strutshttp://jakarta.apache.org/struts. Extract the file ito your favorite directory and copy struts-blank.war,struts- documentation.war and struts-example.war from "jakarta- struts-1.1\webapps" directtory into "jakarta-tomcat-5.0.4\ webapps" directory. - - struts-blank.war is the blank struts application which is useful in creating struts application from scratch. We will use this file to create our web application. - struts-documentation.war contains API and important documents for the struts application development. - struts-example.war is simple MailReader Demonstration Application.