What is the difference between MVC1 and MVC2

I am using MVC design pattern in jsp-servlet web application and want exactly what is the difference between MVC1 and MVC2, can anyone help?

EDIT Recently I heard that there are 2 versions of using MVC in servlet programming, I heard that in MVC1 there is a certain connection between the controller and the view, but in MVC2 they overtake it, if someone knows if it is right or not, I will be very grateful.

+4
source share
3 answers

You may have read this version in connection with asp.net MVC, as there are different versions of this structure. There is no version 2.0 of the mvc template, just version 2.0 of the asp.net MVC framework.

In the context of jsp servlets, see Model 1 and Model 2 . In a nutshell: Model 1 does not have a controller to send requests, model 2 does.

+10
source

In MVC 1, the controller and model are both JSPs. While in MVC2, the servlet and model are a java class. In MVC1, there is a tight connection between the page and the model, since data is usually accessed using a custom tag or through a java bean call.
MVC2 architecture has only one controller, which receives the entire request for the application and is responsible for taking appropriate actions in response to each request.

+4
source

MVC1 was the first generation approach that used JSP pages and the JavaBeans component architecture to implement MVC architecture for the Internet. HTTP requests are sent to a JSP page that implements the logic of the controller and invokes a model for the data to update the view. This approach combines the Controller and View functions on the JSP page and therefore violates the MVC paradigm. MVC1 is suitable for simple development and prototyping. However, this is not recommended for serious development.

MVC2 is a term invented by Sun to describe MVC architecture for web applications in which HTTP requests are sent from the client to the Controller servlet, which updates the model and then invokes the corresponding View rendering, for example, JSP technology, which, in turn, displays a view from an updated model. The key to MVC2's approach is to separate controller code from content. (View implementations such as Struts adhere to the MVC2 approach.)

What I found here: http://www.theserverside.com/discussions/thread.tss?thread_id=20685

0
source

Source: https://habr.com/ru/post/1334144/


All Articles