file_1683178824_0003311_struts2
file_1683178824_0003311_struts2
Apache
provides a free source to download Struts for users. It follows the MVC (Model
View Controller) pattern. There are three models in MVC – Model0, Model1,
Model2.
Struts in Java are used to develop web applications which are usually based on
servlet and JSP. It simplifies the development and maintenance of web
applications by providing predefined functionality. It is based on a front
controller, which means it has a controller in front of it which decides on which
model request has to come or go. Struts in Java are very helpful for us as MVC
is a guideline followed by all technologies in today’s world. There is no better
option to simplify web applications other than MVC. Struts are not distributed.
Model 1 Architecture
Servlet and JSP are the main technologies to develop the web applications.
JSP overcomes almost all the problems of Servlet. It provides better separation
of concern, now presentation and business logic can be easily separated. You
don't need to redeploy the application if JSP page is modified. JSP provides
support to develop web application using JavaBean, custom tags and JSTL so
that we can put the business logic separate from our JSP that will be easier to
test and debug.
As you can see in the above figure, there is picture which show the flow of the
model1 architecture.
Model The model represents the state (data) and business logic of the
application.
View The view module is responsible to display data i.e. it represents the
presentation.
Controller The controller module acts as an interface between view and model.
It intercepts all the requests i.e. receives input and commands to Model / View
to change accordingly.
The following steps demonstrate how to create a simple form that collects user
data, performs simple validation, and outputs the data on a success page.