Js|servlet
SummaryThis paper introduces the implementation framework of a web-based management information system. With the Jsp/servlet technology and MVC design pattern, the development process is more flexible and easier to maintain.
Key WordsManagement Information System, JSP,SERVLET,MVC design mode, JDBC
1. Introduction
Management Information System (MIS) is a system of collecting, transmitting, storing, processing and using information, which is composed of people, computers and so on. With the development of science and technology and the expansion of information, Enterprise Informatization has become one of the effective means of Enterprise's unbeaten position in competition. MIS can not only provide information and data in a timely and comprehensive way, simplify the statistic work, put forward different reports to different management levels, but also predict the future situation according to the past data. Therefore, it is very important to develop a management information system which takes into account the development efficiency and operational efficiency, and satisfies the distributed event processing function. This paper describes a method of constructing three-layer management information system using Jsp/servlet.
2, the system three-tier architecture
The three-tier architecture of the system is shown in Figure 1.
Figure 1 Web application architecture based on Java technology
The whole management Information system adopts the browser/web/database three-layer architecture. The Web server accepts the request, executes a Java server-side applet servlet through the application server, and returns its output to enable interaction with the client for information resources. The database server is used to store the various data used in the management information system, and the data is entered directly by the database management program. The client of the system needs only one browser. Related personnel through the browser to query, add, modify, delete data, the information management.
3, the system design mode
Design pattern is a formal representation of object-oriented program designers to solve programming problems. Currently, in most Browser/server architecture Web applications, browsers interact directly with the user in the form of HTML or JSP, responding to user requests. Although very intuitive, but most of the management information system operation of the data volume is amazing, as the code increases will make JSP pages bloated, Web server overload. Therefore, the design pattern based on Model View Controller (Mvc,model-view-controller) is adopted on the intermediate layer. The model layer is used to implement the business logic, the view layer is used to display the user interface, the controller layer is mainly responsible for the control relationship between the view layer and the model layer. When implemented, the servlet is used as the controller of the application, and the JSP document is used as a view, and JavaBeans is applied to represent the model. All requests are sent to the servlet as the controller, which accepts the request and sends them to the appropriate JSP to respond to the request information. At the same time, the servlet generates JavaBeans instances and outputs them to the JSP environment based on the requirements of the JSP. The JSP can get the data in the Java beans either by calling the method directly or by using the custom label of the use Bean. This design pattern realizes the separation of the data layer and the presentation layer well, and makes the development work easier and faster. In this design pattern, data transfer between tiers is shown in Figure 2.
Figure 2 Data transfer diagram of MVC design pattern
4. Data access Technology
Database is the core content of management information system. At present, there are many web and database interface technologies, in which JDBC is the application interface of Java program connecting and accessing database, consisting of a set of classes and interfaces written in the Java language and a Java API for executing SQL statements. In the management information system introduced in this paper, the JSP/SERVLET+JDBC technology is adopted in the data access, that is, the client does not produce the database query command, and the browser on the client establishes the connection through the URL and the middle-tier Web server. The Web server is primarily responsible for receiving HTTP data requests from local or remote browsers, and then the middle-tier servlet receives the request and uses the standard APIs provided by JDBC to access and manipulate the database through executing the SQL statements in the program. The servlet then passes the queried data to the JSP, and finally generates a standard JSP page that returns the results to the requesting browser. This will not only separate the client from the database server, but also improve the access efficiency of the database.
[1] [2] Next page