So far, in JSP, what we do was Model1, and in this post, we will explore Model2.

The biggest difference between Model1 and Model2 is whether there is Servlet(Controller class) or not. 

Here are the architectures of each model. 

Source: Oracle
Source: Oracle

In Model1, we use only JSP, JSP, or Java Bean. It is relatively easy to learn and fast to develop. 

However, it can be confusing on the JSP page since the presentation, and business logic are on one page. For this reason, it is sometimes hard to separate the developer's and the designer's work. 

 

On the other hand, Model2 separates the roles of the application into model, view, and controller. It is certainly easy to maintain and expand the service and split the responsibility of each developer and the designer. However, as it is better arranged than Model1, the projects often take longer. Moreover, the programmers must understand the MVC(Model-View-Controller) structure. 

 

So, what is MVC? 

MVC is a development methodology that separates the application into three parts: Model, View, and Controller. 

Model process the application's data by using the service and DAO class. View process the user interface, normally designers develop this part, consisting of EL(Expression Language) and JSTL(JSP Standard Tag Library). The controller adjusts the flow between the Model and View with the Java Servlet. 

To know better about the MVC patterns, we first need to study Java Servlet, EL(Expression Language), and JSTL(JSP Standard Tag Library) and in the next posts, we will study more about them.

'Java > JSP' 카테고리의 다른 글

JSP) EL(Expression Language)  (0) 2022.09.16
JSP) Model2 - Java Servlet 1  (0) 2022.09.15
JSP) JSP and Oracle  (0) 2022.08.31
JSP) JavaBean  (0) 2022.08.31
JSP) Action tags - include  (0) 2022.08.31

+ Recent posts