Font Size: a A A

Optimization And Improvement Of MVC Controller Based On Spring Framework

Posted on:2012-06-16Degree:MasterType:Thesis
Country:ChinaCandidate:G ShaoFull Text:PDF
GTID:2218330338962118Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
In the recent years, the multi-layer Web application based on B/S model has been developing rapidly with the rapid development of Internet technology, because of its generality, usability, flexible expansibility and other advantages. For a wide range of applications, the multi-layer Web application based on B/S model is increasingly becoming the mainstream technology of realizing enterprise application systems, especially in the giant system such as Web portals,B2B online shopping website, financial website.With the wide application of the Web technology, a lot of enterprises want to build their own web business systems in the urgent needs, although these business systems vary with specific businesses, but from the software development perspective, the developing process of all these application systems is generally the same. According to the similar web application systems, it is particularly important that how to reduce the repeated technology, how to improve the productivity and utilization ratio of the software of the enterprise. Therefore, a more feasible solution is to develop a generic Web application developing model, which forms a standard software development process, to make developers only focus on business analysis and realization. In the development of Web application systems, various technologies arise at the historic moment and emerge in endlessly, the MVC(Model-View-Controller) pattern of application development has become the mainstream mode among them, it provides a layered architecture:model layer, view layer and control layer. With J2EE Framework appearing, the three-layer structure makes the MVC pattern get more extensive application and development.In the J2EE/MVC framework of multi-layer web application system, the realization methods of model layer, view layer and control layer are varied. For Spring MVC are playing an extremely important authoritative and representative role in the industry, this paper will take the Spring MVC as examples, introducing the concept, structure, components of the MVC pattern, and the principle, working mode, characteristic and advantages of the Spring MVC. Based on this, it will propose two shortages of the controller design of Spring MVC in the practical application:first, it overly relies on Servlet API, which makes it difficult to have unit tests; second, the handling of the controller cache needs to call Servlet caching mechanism, which is lack of flexibility. This article gives the optimization of the controller design of the MVC in view of the two shortages, then the application example and unit test will be given on the basis of optimized; finally, it will give the actual application of the optimization module in the project.
Keywords/Search Tags:MVC, Spring, Spring MVC, controller, Servlet, Unit Test
PDF Full Text Request
Related items