CN102968307A - Java-based web development middleware - Google Patents

Java-based web development middleware Download PDF

Info

Publication number
CN102968307A
CN102968307A CN2012105011323A CN201210501132A CN102968307A CN 102968307 A CN102968307 A CN 102968307A CN 2012105011323 A CN2012105011323 A CN 2012105011323A CN 201210501132 A CN201210501132 A CN 201210501132A CN 102968307 A CN102968307 A CN 102968307A
Authority
CN
China
Prior art keywords
data
template
database
web
assembly
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105011323A
Other languages
Chinese (zh)
Other versions
CN102968307B (en
Inventor
李星
杨成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Communication University of China
Original Assignee
Communication University of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Communication University of China filed Critical Communication University of China
Priority to CN201210501132.3A priority Critical patent/CN102968307B/en
Publication of CN102968307A publication Critical patent/CN102968307A/en
Application granted granted Critical
Publication of CN102968307B publication Critical patent/CN102968307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a java-based web development middleware. The java-based web development middleware comprises an action module and a data access module, wherein the action module is in charge of receiving http request data, sending the data to an appointed logic treatment unit for processing, generating webpage data in required format for treatment results of corresponding logic treatment units, and displaying the webpage data in a browser; the data access module is in charge of receiving and executing an operation request on a database, achieving automatic mapping of the database and a javabean object by utilizing an MQL (MetaQuotes Language) script language, and converting the complex operation on the database into the operation on the javabean object; in the logic treatment process, the need of personalized treatment is met in a way of inserting an interceptor; and in the webpage generation process, a template mode and a non-template mode are provided at the same time, and in the template mode, a webpage generation format is defined by a template based on an XML (Extensive Markup Language) marking mode. By utilizing the development middleware, the web development process is flexible and quick, the complex database operation is simplified, the web development cycle can be shortened, and the development efficiency is improved.

Description

A kind of web exploitation middleware based on java
Technical field
The invention belongs to computer realm, relate to web development technique and database access technology, more specifically, relate to the web exploitation middleware based on java.
Background technology
Because the develop rapidly of network, a lot of web Development Framework based on java have appearred, wherein, Struts, Spring, Hibernate is the java web exploitation framework of current popular, belong to respectively difference increase income tissue or company, and be directed to specific field and realize that its function: struts is responsible for the collection of external data, hibernate is responsible for the persistence of database, spring then is responsible for the example of object, far call etc.The three combines and can form the development structure of a java web, current this three has been developed very hugely, if cause in some compact applications, adopting this structure can cause system development too fat to move, learning cost is too high, and some are developed separately on this basis based on the Technology Need of web could form effect.
When developing in addition java web application, do not use template or framework, if make up from underlying basis, will cause inefficiency, the construction cycle is long, and is difficult in maintenance, and the training cycle is long, the web technological development of repetition.
On the other hand, use template development, really can improve development efficiency, but template development all can fix some basic contents, the user can not arbitraryly carry out comprehensive autonomous Design, and can be in passive state on bottleneck problem, can't do optimization.
Simultaneously, database manipulation also is a problem that allows the exploitation personnel have a headache in the web exploitation, need to set up a kind of easily database, object map, the operation of reduced data storehouse.
Summary of the invention
In view of above-mentioned, the object of the present invention is to provide a kind of light weight efficiently based on the web of java exploitation middleware, provide to receive the web request, carry out logical process, and with the Development Framework of its result generating web page that returns; Simultaneously, also provide a kind of database based on MQL, object map mode.In the logical process of this middleware, provide to insert the mode of blocker, satisfied changeable individual demand.In webpage generates, provide template and non-template dual mode, taken into account simultaneously the dirigibility and the agility that generate the page.Based on database, the object map of MQL, simplified loaded down with trivial details database manipulation.Use the present invention, can make the web exploitation flexible and efficient, shorten the construction cycle.
Web exploitation middleware based on java of the present invention comprises:
Action module, be responsible for receiving the http request msg, and the Logical processing unit that these data mail to appointment processed, then, generate the web data that needs form with the result of respective logic processing unit processes, in browser, show, in webpage generates, provide based on template with not based on the template dual mode, in based on template way, adopt predefined XML template restrictive rule, set the form of generating web page; In logical process, insert blocker by ground, to finish the Extraordinary processing demands; The assembly that action module comprises and typical execution sequence such as accompanying drawing 1, action module comprises following assembly:
The task allocation component according to configuration file, is given the processing logic of appointment with different web requests;
Web data-switching assembly will be converted to from the data that web receives the data object of task processing components appointment;
The task processing components is used for finishing required logical process;
Interception assembly is used for before the task processing modules process, and request is processed to web, and the developer can oneself define blocker, to finish the personalized function that oneself needs;
The result returns assembly, and the result data of Logical processing unit are converted to web data, returns to browser display.
The result returns the result type that assembly returns and comprises the base type, the redirect type, and the redirectAction type, the types such as json type, wherein:
The Base type is directly returned the content of response;
Redirect type return jump connects;
The redirectAction type is issued next action with data and is processed;
The json type return and have key:value ... the json string of form;
In the base type, can use a kind of template based on predefined XML restrictive rule, press the template style generating web page.
The typical execution sequence of each assembly in the action module is seen accompanying drawing 1, and the http request is specified corresponding processing logic by the task allocation component first; Then, the data in the described request are converted to the type that needs in the logical process by web data-switching assembly; Afterwards, if blocker is arranged, then the sequencing by the blocker configuration calls a blocker successively; Again, do logical process by the logical process assembly; At last, the result of above-mentioned logical process is produced webpage by the result treatment assembly, send browser display.
Data access module be responsible for to receive and the operation requests of performing database, utilizes the MQL script, and the automatic mapping of fulfillment database and javabean object is converted into operation to the javabean object with the complex operations of database; The assembly that Data access module comprises and typical execution sequence thereof as shown in Figure 2, Data access module comprises following assembly:
The database manipulation interface module is for the data base querying interface that variable granularity is provided;
The session management assembly is used for finishing the mutual session management of web;
The issued transaction assembly is used for the performing database affairs;
The rollback processing components is used for the rollback of performing database operation;
The basic operation assembly is used for carrying out common database and increases, deletes, changes, looks into operation;
Database, object map assembly are used for the mapping of fulfillment database and javabean object, wherein, use the MQL script, and the javabean object association of the table in the database and appointment is got up, and finish the mapping between data and target; This related Javabean is with specific note, to finish the mapping between data and target.
The typical execution sequence of each assembly as shown in Figure 2 in the Data access module: at first, by the database manipulation interface module, initiate data manipulation; Then, the session management assembly can be set up a session, and manages this session; Afterwards, according to granularity and the type of database manipulation, determine to call basic operation assembly, issued transaction assembly or rollback processing components; Again, by database, object map assembly operation map to database, is obtained the database manipulation result.
Description of drawings
According to following detailed description of carrying out with reference to accompanying drawing, it is more apparent that the features and advantages of the present invention will become.In the accompanying drawings:
Fig. 1 shows the data flow that action module is processed the web request;
Fig. 2 shows the flow process of template generating web page data in the action module;
Data flow when Fig. 3 shows the request of Data access module process database operations;
Fig. 4 shows a kind of realization of action module;
Fig. 5 shows a kind of realization of Data access module;
Fig. 6 shows the treatment scheme that realizes object map with MQL;
Embodiment
Realization of the present invention is described below.Should be understood that the enforcement of this paper can be with varied form imbody, and disclosed any concrete structure, function or both only are representational in this article.Based on the instruction of this paper, those skilled in the art should be understood that an aspect disclosed herein can be independent of any other side and realize, and the two or more aspects in these aspects can make up according to variety of way.
Web exploitation middleware based on java mainly comprises two modules: action module and Data access module.
Action module is responsible for receiving the http request msg, and these data are mail to the Logical processing unit of appointment, then, the result of respective logic processing unit processes is generated the web data form that needs, and shows in browser.Accompanying drawing 4 is a kind of realizations of action module:
In the present embodiment with webpage mutual be the BasicFilter class, its core is the Forward class, it has been responsible for whole task and has distributed, suitable routing function, which logic it can specify process which web page according to the information of configuration file, and BasicFilter, Forward class have consisted of task allocation component of the present invention together.Ensuing DefaultActionInvocation class is a type adaptation device, realizes data type conversion, variable mapping etc., and it has consisted of web data-switching assembly of the present invention.Then be several blockers, interceptor1, interceptor2, ...., blocker is developer oneself definition, blocker is for the developer provides personalized function customization, be used for satisfying the own needs customization of some developers special ability, these blockers have consisted of interception assembly of the present invention.
Return results is encapsulated by object IResult, and the type of return results can be basic base type, the redirect type, and these two kinds all is directly data to be beamed back browser; The redirectAction type, it is data directly to be mail to next action action form an action action logic processing chain, the json type, return and have key:value ... the data of form, then beam back browser.
About template, mould plate technique mainly is in order to solve such as form, the design such as chart, under development, it is how data show that the developer often faces maximum, so providing of template also is a kind of mode of fast Development.
Template in the present embodiment also is the realization of IResult, when the middleware judges developer is when using Template, will obtain template file according to configuration file, template file is designed to the XML form of middleware constraint, as<tablelist〉data will be shown as tabulation, final template file will be translated into the html form of standard, if the developer thinks oneself other form of translation certainly, then as long as realized relevant interface, after translate end, be sent to browser display.Following is the example of Template:
Figure BDA00002493130500051
The database manipulation request that Data access module is responsible for receiving service logic utilizes the MQL script, and the automatic mapping of fulfillment database and javabean object will be converted into to the complex operations of database the operation to the javabean object.Accompanying drawing 5 is a kind of realizations of Data access module:
In the present embodiment, the core of Data access module is Session, and it and ConnectionProvider, SessionFactoryc, SessionUtil have consisted of session management assembly of the present invention together.SessionQuery is used for carrying out the basic operation of database, Transaction is used for the management database affairs, Rollback is used for the rollback of db transaction, because there is granularity in operating database, so up encapsulated again one deck Query interface towards the developer time.Wherein the form of javabean is adopted in the mapping of Data access module and database, concrete video display method has adopted the MQL script, and by MQL, the table in the database will carry out related with the javabean of appointment, reach the automaticdata mapping, simple realization ORM model.For example: MQL:update@Ds_basic set college_name@Ds_basic<=' #{college_name}'whereid@Ds_basic=<#{id@1}and name@Ds_basic='#{name@2}', in the present embodiment, at first it can be formatted as standard format, then extract variable, such as the #{id@1} in this example, to be converted into a class, second step behind the replacement variable begins the mapping (enum) data table, that@Ds_college expresses is developer's a javaBean, this javaBean has special note (such as Entity, Field) javaBean, middleware will extract the information of the table of Ds_college association, form final SQL, then other assembly that the resolution data of MQL is sent to Data access module comes the performing database operation, and it specifically uses flow process as follows.
Developer's input,
MQL:update@Ds_basic?set?college_name@Ds_basic<='#{college_name}'where?id@Ds_basic=<#{id@1}and?name@Ds_basic='#{name@2}',
(not drawn together by the #{}) system that wherein has the@mark arrives respective table with automatic mapping, and respective field is also shone upon; Generally referred to parameter information by the place of #{}.
The javabean that the self-defining band of developer is explained, following form:
Figure BDA00002493130500061
Wherein the statement that begins of@is for explaining,
The table that note@Entity (table=" abc ") has specified this javabean to be mapped to database is abc;
Explaining@Field (name=" cname ") has specified the college_name member variable to be mapped as the cname field of database table abc.All the other marks can be by that analogy.
If this object has following assignment:
Ds_basic?Ds_basic_object=new?Ds_basic();
Ds_basic_object.college_name=’cuc’;
Ds_basic_object.id=23;
Ds_basic_object.name=’xiaolee’;
System finally can generate following sql statement:
update?abc?set?cname<='cuc'where?id=<23?and?name='xiaolee'
If query statement, system can carry out returning an object value or object set according to Query Information.
Provided the treatment scheme of MQL realization object map in the accompanying drawing 6.Wherein after the request of MQL interpreter reception from operation layer, utilize the mapping relations between MQL language and javabean object and the database, generate corresponding actual database action statement, and carry out this statement, with the operation of database.If this statement does not have returning an object value, then directly return operation layer, if returning an object value is arranged, then pass through the MQL interpreter after, the return results object is to operation layer.

Claims (7)

1. the web based on java develops middleware, comprising:
Action module, be responsible for receiving the http request msg, and the Logical processing unit that these data mail to appointment processed, then, generate the web data that needs form with the result of respective logic processing unit processes, in browser, show, in webpage generates, provide based on template with not based on the template dual mode, in based on template way, adopt predefined XML template restrictive rule, set the form of generating web page; In logical process, insert blocker by ground, to finish the Extraordinary processing demands;
Data access module is responsible for receiving and carrying out the database operation requests, utilizes the MQL script, and the automatic mapping of fulfillment database and javabean object will be converted into to the complex operations of database the operation to the javabean object.
2. middleware as claimed in claim 1, wherein action module comprises:
Web data-switching assembly will be converted to from the data that web receives the data object of Logical processing unit appointment;
The task allocation component according to configuration file, is given the processing logic of appointment with different web requests;
The task processing components is used for finishing required logical process;
Interception assembly was used for before the task processing modules process, and request is processed to web, and the developer can by oneself definition blocker, finish the personalized function that needs;
The result returns assembly, and the result data of logical process is converted to web data, returns to browser display.
3. middleware as claimed in claim 1, wherein Data access module comprises:
The session management assembly is used for finishing the mutual session management of web;
The operation-interface assembly is for the database manipulation interface that variable granularity is provided;
Data, object map assembly are used for the mapping of fulfillment database and javabean object.
4. action module as claimed in claim 2, wherein, the feature that the result returns assembly comprises:
The return results type comprises the base type, the redirect type, and the redirectAction type, the types such as json type, wherein,
The Base type is directly returned the content of response;
Redirect type return jump connects;
The redirectAction type is issued next action with data and is processed;
The json type return and have key:value ... } the json string of form.
5. action module as claimed in claim 2, wherein,
Interception assembly is optional components, and foundation needs not dispose blocker, also configurable one or more blocker;
When blocker when being a plurality of, call successively by the sequencing of blocker configuration.
6. result as claimed in claim 4 returns in the assembly, and its base type return results feature is as follows:
Can select based on template way with not based on template way according to needs, wherein, based on template way, provide a kind of template based on predefined XML restrictive rule, press the template style generating web page; In webpage generates, at first judge whether to adopt template, if adopt template, at first read in template file, then this document is done parsing, generate at last the webpage of template definition form; For the page that does not adopt template way, directly generate the page.
7. Data access module as claimed in claim 3, data, object map module diagnostic comprise:
Use the MQL script, the javabean object association of the table in the database and appointment is got up, finish the mapping between data and target;
Javabean is with specific note, to finish the mapping between data and target.
CN201210501132.3A 2012-11-29 2012-11-29 A kind of web based on java develops middleware Active CN102968307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210501132.3A CN102968307B (en) 2012-11-29 2012-11-29 A kind of web based on java develops middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210501132.3A CN102968307B (en) 2012-11-29 2012-11-29 A kind of web based on java develops middleware

Publications (2)

Publication Number Publication Date
CN102968307A true CN102968307A (en) 2013-03-13
CN102968307B CN102968307B (en) 2016-02-24

Family

ID=47798465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210501132.3A Active CN102968307B (en) 2012-11-29 2012-11-29 A kind of web based on java develops middleware

Country Status (1)

Country Link
CN (1) CN102968307B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270443A (en) * 2014-09-29 2015-01-07 北京掌中经纬技术有限公司 Cloud computing system and method capable of dynamically analyzing Web application
CN105993010A (en) * 2014-02-11 2016-10-05 德州仪器公司 Methods and apparatus to provide extended object notation data
CN107168993A (en) * 2017-03-29 2017-09-15 广州优视网络科技有限公司 Handle method, equipment, client device and the electronic equipment of response data
CN107861758A (en) * 2016-12-30 2018-03-30 平安科技(深圳)有限公司 Kit assemble method and device
CN107943870A (en) * 2017-11-10 2018-04-20 顺丰科技有限公司 For improving the method and its equipment of distributed data base middleware stability
CN108241705A (en) * 2016-12-27 2018-07-03 北京神州泰岳软件股份有限公司 A kind of data insertion method and device
CN109086034A (en) * 2018-07-13 2018-12-25 山东恒云信息科技有限公司 Injection, which is relied on, using AOP and Spring realizes the method for applying automatic duplicating of data
CN110263279A (en) * 2019-05-08 2019-09-20 北京字节跳动网络技术有限公司 Page generation method, device, electronic equipment and computer readable storage medium
CN111078213A (en) * 2018-10-18 2020-04-28 马上消费金融股份有限公司 Code generation method and code generation device
CN111475534A (en) * 2020-05-12 2020-07-31 北京爱笔科技有限公司 Data query method and related equipment
CN111522601A (en) * 2020-04-22 2020-08-11 北京思特奇信息技术股份有限公司 Back-end operation method and system for flexibly configuring multiple component tasks
CN112052256A (en) * 2020-09-02 2020-12-08 平安资产管理有限责任公司 Multi-version request returning method and device, computer equipment and readable storage medium
CN112364280A (en) * 2020-10-27 2021-02-12 深圳开源互联网安全技术有限公司 Dynamic adaptation method, system, device and storage medium for paging query
CN113656306A (en) * 2021-08-16 2021-11-16 杭州安恒信息技术股份有限公司 SQL statement test method, system, storage medium and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993694A (en) * 2004-07-30 2007-07-04 西门子公司 Method programme and system for the dynamic template-based generation of internet pages
CN101165685A (en) * 2006-10-19 2008-04-23 国际商业机器公司 Dynamic web page generation method and system
CN102117203A (en) * 2009-12-30 2011-07-06 上海杉达学院 Information management system based on Struts frame
CN102495729A (en) * 2011-12-02 2012-06-13 曙光信息产业(北京)有限公司 Application-based web page job submission display method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993694A (en) * 2004-07-30 2007-07-04 西门子公司 Method programme and system for the dynamic template-based generation of internet pages
CN101165685A (en) * 2006-10-19 2008-04-23 国际商业机器公司 Dynamic web page generation method and system
CN102117203A (en) * 2009-12-30 2011-07-06 上海杉达学院 Information management system based on Struts frame
CN102495729A (en) * 2011-12-02 2012-06-13 曙光信息产业(北京)有限公司 Application-based web page job submission display method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘昆: "基于J2EE平台的轻量级框架的应用研究", 《中国优秀硕士学位论文全文数据库》, 15 September 2008 (2008-09-15) *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105993010A (en) * 2014-02-11 2016-10-05 德州仪器公司 Methods and apparatus to provide extended object notation data
CN104270443B (en) * 2014-09-29 2017-12-12 北京掌中经纬技术有限公司 A kind of cloud computing system and method for being capable of dynamic analysis Web applications
CN104270443A (en) * 2014-09-29 2015-01-07 北京掌中经纬技术有限公司 Cloud computing system and method capable of dynamically analyzing Web application
CN108241705A (en) * 2016-12-27 2018-07-03 北京神州泰岳软件股份有限公司 A kind of data insertion method and device
CN107861758A (en) * 2016-12-30 2018-03-30 平安科技(深圳)有限公司 Kit assemble method and device
CN107168993A (en) * 2017-03-29 2017-09-15 广州优视网络科技有限公司 Handle method, equipment, client device and the electronic equipment of response data
CN107943870A (en) * 2017-11-10 2018-04-20 顺丰科技有限公司 For improving the method and its equipment of distributed data base middleware stability
CN109086034B (en) * 2018-07-13 2021-07-02 山东恒云信息科技有限公司 Method for realizing automatic backup of application data by AOP and Spring dependent injection
CN109086034A (en) * 2018-07-13 2018-12-25 山东恒云信息科技有限公司 Injection, which is relied on, using AOP and Spring realizes the method for applying automatic duplicating of data
CN111078213B (en) * 2018-10-18 2024-01-19 马上消费金融股份有限公司 Code generation method and code generation device
CN111078213A (en) * 2018-10-18 2020-04-28 马上消费金融股份有限公司 Code generation method and code generation device
CN110263279B (en) * 2019-05-08 2021-08-10 北京字节跳动网络技术有限公司 Page generation method and device, electronic equipment and computer readable storage medium
CN110263279A (en) * 2019-05-08 2019-09-20 北京字节跳动网络技术有限公司 Page generation method, device, electronic equipment and computer readable storage medium
CN111522601A (en) * 2020-04-22 2020-08-11 北京思特奇信息技术股份有限公司 Back-end operation method and system for flexibly configuring multiple component tasks
CN111475534A (en) * 2020-05-12 2020-07-31 北京爱笔科技有限公司 Data query method and related equipment
CN111475534B (en) * 2020-05-12 2023-04-14 北京爱笔科技有限公司 Data query method and related equipment
CN112052256A (en) * 2020-09-02 2020-12-08 平安资产管理有限责任公司 Multi-version request returning method and device, computer equipment and readable storage medium
CN112364280A (en) * 2020-10-27 2021-02-12 深圳开源互联网安全技术有限公司 Dynamic adaptation method, system, device and storage medium for paging query
CN113656306A (en) * 2021-08-16 2021-11-16 杭州安恒信息技术股份有限公司 SQL statement test method, system, storage medium and computer equipment
CN113656306B (en) * 2021-08-16 2024-04-09 杭州安恒信息技术股份有限公司 SQL statement testing method, system, storage medium and computer equipment

Also Published As

Publication number Publication date
CN102968307B (en) 2016-02-24

Similar Documents

Publication Publication Date Title
CN102968307B (en) A kind of web based on java develops middleware
CN102541541B (en) Interface creating method and device
CN101127655B (en) Method and system for integrating existing www systems
CN101957758B (en) Method for realizing rapid Web Service publishment in service oriented architecture application systems
CN110096689A (en) Template type legal documents information fill method and device
CN109614102A (en) Code automatic generation method, device, electronic equipment and storage medium
CN101815093A (en) Method for adapting webpage to mobile terminal and mobile terminal page adaptation device
CN103077024B (en) A kind of device and method supporting the on-demand customization of SaaS application flow and operation
CN103077185A (en) Object-based user-defined information-expanding method
CN104156313A (en) Method for automatically generating Web service testing case
CN106708480A (en) Management platform realization method and apparatus
CN107463409A (en) A kind of interface conversion method, interface convertor, storage medium and electric terminal
CN101694618A (en) Automatic mapping method of model layer and view layer data suitable for AJAX frame
CN103902286A (en) Hierarchy type multi-source data fusion method based on SOA
CN102566984B (en) Method and device for configuring parameters
CN101727324A (en) Code generation method and device
CN101599015A (en) A kind of method and system of analyzing component
CN105930138B (en) A kind of message treatment method and device
CN101976199A (en) Object-oriented middleware distributed system development platform
CN104881490A (en) WEB form data access method and system
CN103064876A (en) Method for obtaining spatial data servitization facing geographic information application
US7945893B2 (en) Mapping web services description language documents to XQuery functions
CN110377892A (en) A kind of government intelligence form templat designing system
CN103390018A (en) Web service data modeling and searching method based on SDD (service data description)
CN102567334A (en) Office automation system based on heterogeneous data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant