Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts:

  • Model - The lowest level of the pattern which is responsible for maintaining data.
  • View - This is responsible for displaying all or a portion of the data to the user.
  • Controller - Software Code that controls the interactions between the Model and View.

MVC is popular as it isolates the application logic from the user interface layer and supports separation of concerns. Here the Controller receives all requests for the application and then works with the Model to prepare any data needed by the View. The View then uses the data prepared by the Controller to generate a final presentable response. The MVC abstraction can be graphically represented as follows.

The model

The model is responsible for managing the data of the application. It responds to the request from the view and it also responds to instructions from the controller to update itself.

The view

A presentation of data in a particular format, triggered by a controller's decision to present the data. They are script based templating systems like JSP, ASP, PHP and very easy to integrate with AJAX technology.

The controller

The controller is responsible for responding to user input and perform interactions on the data model objects. The controller receives the input, it validates the input and then performs the business operation that modifies the state of the data model.

Struts2 is a MVC based framework. In the coming chapters, let us see how we can use the MVC methodology within Struts2.

Struts 2 Tutorial Basic MVC Architecture的更多相关文章

  1. ExtJS笔记3 MVC Architecture

    MVC Architecture   MVC架构 Contents File Structure Creating the application in app.js Defining a Contr ...

  2. Basic Printing Architecture

    https://blogs.technet.microsoft.com/askperf/2007/06/19/basic-printing-architecture/ Printer sharing, ...

  3. (一)Spring’s MVC Architecture

    Spring’s MVC module Spring’s MVC module is based on front controller design pattern followed by MVC ...

  4. What is difference between 3-layer architecture and MVC architecture?

    By Vikas Singh on Sep 26, 2014 In 3-layer architecture  3-layer architecture separates the applicati ...

  5. Struts 2 Tutorial

    Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applicati ...

  6. 用struts和hibernate结合MVC层实例

    1.倒包hibernate11个包+sturts2 13个包 2.创建web.xml <?xml version="1.0" encoding="UTF-8&quo ...

  7. Spring、struts、webwork2三者MVC的比较

    http://blog.sina.com.cn/s/blog_4a69fa43010005il.html 在web应用方面,Spring有独立的MVC实现,与struts和webwork2相比毫不逊色 ...

  8. 对spring,struts,hibernate及MVC的理解

    对于spring,hibernate,struts等框架,刚开始的时候总是会很迷茫,不知道他们是用来做什么的. 1.对框架的作用理解 个人认为框架的作用是把代码进行了分类,减少了代码的耦合性. 如果不 ...

  9. Struts+Spring+Hibernate、MVC、HTML、JSP

    javaWeb应用 JavaWeb使用的技术,比如SSH(Struts.Spring.Hibernate).MVC.HTML.JSP等等技术,利用这些技术开发的Web应用在政府项目中非常受欢迎. 先说 ...

随机推荐

  1. Eclipse开发java程序里Test用不了,怎么导包?

    1.右键项目Build Path->Add External JARs,选择要导入的jar包即可: 2.建立方法,引入junit. 3.ok

  2. RCNN,fast R-CNN,faster R-CNN

    转自:https://www.cnblogs.com/skyfsm/p/6806246.html object detection我的理解,就是在给定的图片中精确找到物体所在位置,并标注出物体的类别. ...

  3. word2vec原理CBOW与Skip-Gram模型基础

    转自http://www.cnblogs.com/pinard/p/7160330.html刘建平Pinard word2vec是google在2013年推出的一个NLP工具,它的特点是将所有的词向量 ...

  4. asp.net获取当前页面的url地址

    设当前页完整地址是:http://www.jb51.net/aaa/bbb.aspx?id=5&name=kelli "http://"是协议名 "www.jb5 ...

  5. 转:iPhone上关于相机拍照的图片的imageOrientation的问题

    用相机拍摄出来的照片含有EXIF信息,UIImage的imageOrientation属性指的就是EXIF中的orientation信息.如果我们忽略orientation信息,而直接对照片进行像素处 ...

  6. Xcode关闭警告

    对于关闭某个警告,如果需要全局关闭的话,直接在Other C Flags里写 -Wno-...就行了,比如 -Wextra -Wno-sign-compare 就是一个常见的组合.如果相对某几个文件开 ...

  7. bzoj千题计划151:bzoj1131: [POI2008]Sta

    http://www.lydsy.com/JudgeOnline/problem.php?id=1131 dp[i]=dp[fa[i]]-son[i]+n-son[i] #include<cst ...

  8. [NOI1997] 积木游戏

    COGS 261. [NOI1997] 积木游戏 http://www.cogs.pro/cogs/problem/problem.php?pid=261 ★★   输入文件:buildinggame ...

  9. Jmeter javaRequest插件开发

    1. 适用场景 Jmeter工具当前支持的协议或协议所支持的传输方式及传输内容不能满足当前项目的测试要求时,就需要根据实际要求手动编写java测试代码(实现对应的Jmeter规范),以插件方式加载到J ...

  10. 【Linux】SecureCRT连接Linux乱码

    SecureCRT连接linux出现乱码问题.解决方法. 打开SecureCRT-->option-->Session option