基于Servlet的MVC控制器框架设计  被引量:5

Design of MVC controller framework based on servlet

在线阅读下载全文

作  者:郑建华[1] 朱蓉[1] 邱振国[1] 

机构地区:[1]仲恺农业工程学院信息科学与技术学院,广东广州510225

出  处:《计算机时代》2015年第4期43-46,共4页Computer Era

基  金:广东省科技计划项目(2012B040500040);广东省科技计划高新技术产业化项目(2012B010100048);广州市海珠区科技计划项目(2014-cg-31)

摘  要:控制器在MVC模式中起着重要作用。分析了J2EE中MVC模式的实现方式,指出了经典的基于Servlet控制器的不足,分析了Struts2中控制器的核心原理。提出了一种基于门面模式和简单工厂模式的轻量级控制器框架,将其命名为"1+N"模式控制器。该控制器主要包括核心控制器和业务控制器,由核心控制器统一响应客户前端的请求,并将请求转换到相应的业务控制器进行处理。给出了该框架中核心类的源代码。该框架易于使用且具有较好的可扩展性和可维护性。The controller plays an important role in the MVC mode, this paper analyzes the implementation of the MVC model in J2EE, poins out the drawback of the classic controller based on Servlet and analyzes the core principle of the controller in Struts2. Then proposes a framework of lightweight controller based on Facade pattern and simple factory pattern, which named as “1 +N” controller. The controller framework incudes core controller and business controller. The core controller responses the client request unified and then transfers the request to the business controller to process. The paper gives the source code of the core class in the framework. The framework is easy to use and has good scalability and maintainability.

关 键 词:MVC 控制器 门面模式 简单工厂模式 核心控制器 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象