International Conference on Advances in Materials, Machinery, Electrical Engineering (AMMEE 2017)
Design and Realization of the declaration of the project based on Struts
spring framework表达式assignframework
Yifei Cong 1, a *, Bin Zou 2 b
1Yantai Engineering &Technology College, Yantai, Shandong Province, 264006, China.
2Wenjing College Yantai University, Yantai, Shandong Province, 264005, China
a***************b*************
Keywords:MVC, Struts, project declaration, examination and approval
Abstract. With the rapid development of information technology, more and more research projects, scientific research institutes, how to make scientific research project application and approval of more efficient, has become an urgent problem to be solved. The Web project declaration system based on can speed up the basic unit scientific research management departments to carry out fast transaction processing, greatly improve work efficiency. This article first has carried on the analysis, the project declaration system's function demand next, on the MVC design pattern and Struts framework are studied, based on the design of Struts framework proposed project reporting system, and to realize it.
1.Introduction
At present, a lot of declaration of science and technology projects are by hand, generally including selecting topics, approving projects, filling out declarations, confirming and reporting the completion process. The project declaration is a tedious task. It is easily faulted by manual reporting. This paper achieves the project application systems based on Web, aiming at providing scientific and technical workers with a network platform for project application, providing system administrator with convenient means of management of project applications, filing management and reporting the systematization, standardization and automation of the project. The project approver will provide one-stop service for the user by using the system to implement the project acceptance, document transfer, project approval
and feedback. After the user enters the filing system, they can submit application and look up the results of the examination. Therefore, the research and development of a web-based project reporting system is of great significance.
Struts is a conceptual framework for the development of Web applications. It is an open source project of Jakarta Apache's foundation project team, implementing the MVC design pattern by coordinating it through a set of classes, Servlets, and taging libraries. Because Struts has become the most popular and mature open source framework, creating a Web application by Java, it is a better choice to create a project application system model based on the Struts' framework, basically satisfying every requirement of the project application. This paper includes the working mechanism of the Struts framework, the analysis of project declaration business, the system design scheme based on the Struts framework, and the implementation of the plan.
2.Design Mode of MVC
MVC, Model-View-Controller, separate the logic and user of the business interface effectively by dividing an application implementation into three layers, namely the Model layer, View layer and control layer. The capabilities and collaborations among the model layer, the view layer, and the control layer are shown in figure 1.
Fig. 1 MVC Component function and collaboration
Layer Model : Formulating the business rules, dealing with business logic according to the request data from the view layer, and returning to the final processing result. The design of the business model is the core of the MVC.
View layer : Interactiing with users, either an HTML page or a JSP page. A Web application may correspond to a lot of different views, which can acquire and display the data rather than handle the business logic. Both the data acquisition and the display depend on the model layer.
Control layer: As a requesting dispenser, it can receive the request of the view layer, tie model layer and view layer together, complete the corresponding user requests by selecting corresponding model and views. A model may correspond to multiple views, and one view may correspond to multiple model
s. If the view layer changes the model's data by controlling the layer, all the views that depend on these models will be able to show these changes in time.
3.The Framework of Struts
The Struts framework provides the corresponding component classes for the model layer, view layer, and control layer in the MVC design pattern. Among them, the model layer is composed of actionforms and javabeans et. Actionforms classes are used to submit the view layer encapsulates the request parameters to the corresponding actionforms, which are forwarded to the Action class from class ActionServlet. The Action class deals with the user's request according to the object actionforms encapsulate request parameters. Specific business logic can be accomplished by the components of JavaBean.. The view layer mainly consists of JSP pages that interact with the model layer in the JSP page through the tag library implementation provided by the Struts framework. Control layer is composed of core controller and the business logic controller systemy, which is of ActionServlet class. It can be configured according to the standard Servlet class. It is also responsible for stopping all HTTP requests, and then determine transferreing to which business logic controller.according to the user request. Business logic controller can be a subclass of the Action class and it is responsible for receiving a request from the ActionServlet class. It processes the request according to the the busines
s logic of the model layer. After this, the results are submitted to the ActionServlet class,. The results are displayed by class ActionServlet on the corresponding JSP page. The collaboration of each of the components in the Struts framework are shown in figure 2:
Fig. 2 The struts framework components form a collaborative relationship
4.System Design
By analyzing the requirements of the project reporting system, we can design the following basic functions: declaration, approval, approval, system management and so on. System user roles can be divided into administrator, declarant and approver and approved. After the user login system, respectively go into the corresponding page according to their work roles. The system design scheme is shown in figure 3. The main functional analysis of the system is as follows
1) Declaration: After logining system, declarants can view the system project information, , nput and submit the corresponding project application information, and view the result of examination and approval at anytime. While the examination and approval failed to be passed, the application information can be modified to submit again.
2) Examination: After the approvers log into the system, they can view the approval tasks assigned, and select the corresponding tasks for approval. If approved, it can be submitted to the corresponding leaders to check. It not, then they will return to the last step where declarant are asked to submit the applying information.
3) Approval: After the approver log into the system, it is possible for them to review the approved tasks
submitted by the approver , and select the corresponding task for approval.
If approved, the task is set to "successful" state. If not, they need to have the suggestions examined again.
4) Management system: System administrators can release, modify, and delete the corresponding project information after logging. They can also manage the users of the system, set user access, monitor approval process through the system log , and manage the result of the examination and approval data.
Fig. 3 System design scheme
5.System Realization
The system is designed based on the Struts framework. Jsp pages serve as the view layers for the system, ActionServlet and the Action class control layer, and ActionForm and the JavaBean model layer. The implementation of the system is shown in figure 4.
5.1Components of view layer
The components of view layer include: Login.jsp page for user to login, apply. Jsp page for the input of the declarating application information. Showresult.jsp page for displaying the user's approval results. Appro.jsp page for examining tasks. Check. JSP page for approving the approval task.
5.2Components of model layer
he components of model layer include Apply Action Form and landapplyBean. Apply Action Form, the subclass of Action Form in the Struts framework, is designed to encapsulate the application information submitted by the user. ProapplyBean is JavaBean for dealing with business logic, which encapsulates the operation of the database and the implement its business logic by invoking the appropriate method. Login check method is used to realize the user login validation, save data method save the user submits the application of project application, queryData method query specified approval task results, approve method hold the approval result information, and check method hold the
approval result information.
5.3Components of control layer
The components of control layer include ActionServlet and Action. ActionServlet comes from the Struts framework, which is the control center for the entire application, and usually does not need to be extended. Using the Struts framework provided by the Action class extension to generate the corresponding subclasses (such as proapplyAction. Java, etc.), it receives requests of ActionServlet, obtains encapsulated data from Apply Action Form, using proapplyBean business method to deal with problems accordingly.
Fig. 4 ActionServlet
After logining to the system, project application will see the corresponding page, on which they fill out input information , submit project application, review the results of examination and approval information, etc. After approvers log in, they can approve tasks on the job page. Action Servlet of control layer will receive various requests from the users, encapsulatie messages into ApplyActionForm through the systematic configuration, and transfer the request to the corresponding Action . It will process businesses by relative methods in JavaBean.
6.Tag
Struts is an excellent MVC framework, focusing on the demand for project application. It sets forth the design and realization of Project Application System based on the framework of Struts. It keeps the page presentation of traditional 3-tier architecture,business process and system control separated from each other, enabling flexibility, scalability and maintainability. The system follows J2EE specification and MVC design pattern, with advantages of cross-platform, low cost, efficient system development, tailorability and reusability,. It solved a series of bottleneck problems in the popularization of the application system, applying for the demand of constructing a project application system, thus possessing certain applicable value.
References
[1].Master the Design and Development of Java Web Based on MVC , Sun Weiqin, electronic
industry press, 2004.8
[2].Design and Implementation Based on Web Project Review Systems in Colleges, Li Yue,
electronic design engineering, 20 Th volume 19, 2012.10.
[3].Design and Implementation Based on Web Research Report System, Zhao Zhengqi and so on,
the journal of anhui electronic information vocational college, June 2011.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论