CN103984549A - General paging query method and system based on SSH framework - Google Patents

General paging query method and system based on SSH framework Download PDF

Info

Publication number
CN103984549A
CN103984549A CN201410203621.XA CN201410203621A CN103984549A CN 103984549 A CN103984549 A CN 103984549A CN 201410203621 A CN201410203621 A CN 201410203621A CN 103984549 A CN103984549 A CN 103984549A
Authority
CN
China
Prior art keywords
paging
query
page
framework
background server
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.)
Pending
Application number
CN201410203621.XA
Other languages
Chinese (zh)
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.)
Upper Marine Infotech Share Co Ltd Of Interrogating
Original Assignee
Upper Marine Infotech Share Co Ltd Of Interrogating
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 Upper Marine Infotech Share Co Ltd Of Interrogating filed Critical Upper Marine Infotech Share Co Ltd Of Interrogating
Priority to CN201410203621.XA priority Critical patent/CN103984549A/en
Publication of CN103984549A publication Critical patent/CN103984549A/en
Pending legal-status Critical Current

Links

Abstract

The invention is applicable to data paging query under a JAVA SSH framework and provides a general paging query method and a general paging query system based on an SSH framework. The method comprises the following steps that map encapsulation is carried out on a query condition by a Web front end, and the encapsulated query condition is sent to a background server in a form submitting mode; paging query is carried out by the background server through a query interface criteria of Hibernate, and feeds back a query result to the Web front end; a front end style configuration constructs a paging display basic framework by a js custom tag and struts 2, and when paging refreshing is carried out, a style which is selected by the paging display is judged and displayed. According to the method and the system, difference operations which are carried out when different pages inquire paging are omitted, item reference numbers are more concise, the framework is clearer, the paging styles of the front end are various, and the style skin of paging can be changed according to the requirements.

Description

A kind of based on the general paging query method and system of SSH framework
Technical field
The present invention relates to the data page inquiry under JAVA SSH framework, relate in particular to a kind of based on the general paging query method and system of SSH framework.
Background technology
Increasing along with paging demand, the variation of pattern and data is shown in required paging, and general paging mode rate of code reuse is low, and development efficiency is not high, and code structure is disorderly and unsystematic, has brought great inconvenience to project development and maintenance.When project is entered to show to the capable form of database data, sometimes do not need data to be found to demonstration by data are disposable, or proposed data to carry out paging query in order to improve data query speed, the data of returning to specified scope from the angle inquiry of clear data also need paging.In summary, obviously there is inconvenience and defect in prior art in actual use, so be necessary to be improved.
Summary of the invention
For above-mentioned defect, the object of the present invention is to provide a kind of based on the general paging query method and system of SSH framework.It saves the difference operation that the different pages carry out during paging in inquiry, and makes item code more succinct, and framework is more clear, and front end paging changing style can be changed the pattern skin of paging according to demand.
To achieve these goals, the invention provides a kind ofly based on the general paging query method of SSH framework, described method comprises the steps:
Web front end carries out map encapsulation by querying condition, and sends to background server by the mode of submission of sheet;
Background server carries out paging query by the query interface criteria of Hibernate, and Query Result is fed back to web front-end;
Front end style configuration is built Pagination Display basic framework by js customized label and struts2, judges that the selected pattern of Pagination Display shows when paging refreshes.
The method according to this invention, the step that Web front end carries out map encapsulation by querying condition comprises: the paging parameter information that the web front-end page is used is stored in Map set with the form of key-value pair, and paging parameter information comprises: record sum, record number, the total page number of current page, every page of demonstration.
The method according to this invention, the step of " background server carries out paging query by the query interface criteria of Hibernate " comprising:
According to passed map condition, current page variable and every page, recording number inquires qualified record and records number.
The method according to this invention, the step of " front end style configuration is built Pagination Display basic framework by js customized label and struts2 " comprising:
Front end is introduced selectable various css pattern files to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.
The present invention is corresponding provides that a kind of described system comprises web front-end and background server based on the general paging query system of SSH framework, and described web front-end comprises:
Package module, for carrying out map encapsulation by querying condition;
Submit module to, the mode by submission of sheet sends to background server by the querying condition after encapsulation;
Style configuration module, for building Pagination Display basic framework by js customized label and struts2, judges that when paging refreshes the selected pattern of Pagination Display shows,
Background server comprises paging query module, and its query interface criteria by Hibernate carries out paging query, and Query Result is fed back to web front-end.
According to system of the present invention, described package module is also stored in Map set for paging parameter information that the web front-end page is used with the form of key-value pair, and paging parameter information comprises: record sum, record number, the total page number of current page, every page of demonstration.
According to system of the present invention, paging query module inquires qualified record and records number for recording number according to passed map condition, current page variable and every page.
According to system of the present invention, style configuration module is used for introducing selectable various css pattern file to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.
The present invention carries out map encapsulation by Web front end by querying condition, and sends to background server by the mode of submission of sheet; Background server carries out paging query by the query interface criteria of Hibernate, and Query Result is fed back to web front-end; Front end style configuration is built Pagination Display basic framework by js customized label and struts2, judges that the selected pattern of Pagination Display shows when paging refreshes.Condition map object and find data object and be Object object, realizes paging for the versatility of various objects; Subordinate's way of reference of the present invention is for being encapsulated into the common code part of the query interface criteria paging query by Hibernate and implementation framework method in class, need to be by the class object access class that paging is shown, only need inherit such then to realize inheritance method and query argument map, number of pages and every page are recorded to number process and return to recording number and recording number of inquiring.Front end style configuration is built Pagination Display basic framework by js customized label and struts2, judges that the selected pattern of Pagination Display shows when paging refreshes.Thereby the present invention can save the difference operation that the different pages carry out during paging in inquiry, and makes item code more succinct, framework is more clear, and front end paging changing style can be changed the pattern skin of paging according to demand.
Accompanying drawing explanation
Fig. 1 is a kind of frame diagram based on the general paging query system of SSH framework of the present invention;
Fig. 2 is a kind of process flow diagram based on the general paging query method of SSH framework of the present invention;
Fig. 3 is the process flow diagram that in an embodiment of the present invention, background server carries out paging query.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, the present invention is a kind of based on the general paging query system of SSH framework, comprises web front-end 10 and background server 20.Web front-end 10 comprises package module 11, submits module 12 and style configuration module 13 to; Background server 20 comprises paging query module 21.
Package module 11 is for carrying out map encapsulation by querying condition.Map is for storage element to (being called " key " and " value "), and wherein each key is mapped to a value.The paging parameter information that package module 11 is used the front end page (recording the parameter informations such as number total, that record current page, every page of demonstration, total page number) is stored in Map set with the form of key-value pair.
Submit to module 12, for the mode by submission of sheet, the querying condition after encapsulation is sent to background server 20.Concrete, submit to module 12 to transmit various ways by submission of sheet or parameter paging information parameter is passed to background server 20.
Style configuration module 13, for building Pagination Display basic framework by js customized label and struts2, judges that when paging refreshes the selected pattern of Pagination Display shows.Style configuration module 13 is for introducing selectable various css pattern file to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.Js customized label is directly nested in the page that needs paging by the mode of introducing or embedding.Struts is the project of increasing income, and it,, by adopting JavaServlet/JSP technology, has realized the application framework of the MVC Design Mode based on JavaEE WEB application, is a classic products in MVC Classic couture pattern.
When paging refreshes, judge that the selected pattern of Pagination Display shows, the protocol rule of specifically certainly being decided through consultation by web front-end 10 and background server 20, carries out regular determination processing by web front-end 10.
In addition, style configuration module 13 can be carried out dynamic-configuration to the number that records of every page of demonstration, and the various ways such as numeral of selecting with text box redirect or combobox are carried out the setting of page data number, and number information is preserved.
Paging query module 21 its query interface criteria by Hibernate carry out paging query, and Query Result is fed back to web front-end.Concrete, the map condition that paging query module 21 passes according to web front-end 10, current page variable and every page record number and inquire qualified record and record number.And condition map object and find data object and be Object object, realize paging for the versatility of various objects.The parameter information value of paging (current page variable, every page record number lamp) is delivered to after background server by web front-end 10, by database, is preserved.
Hibernate is the Object Relation Mapping framework of an open source code, and it has carried out the very object encapsulation of lightweight to JDBC, makes java applet person arbitraryly with Object Programme thinking, to come manipulation data storehouse.The core interface one of Hibernate has 6, is respectively: Session, SessionFactory, Transaction, Query, Criteria and Configuration.Query interface (org.hibernate.Criteria) Criteria has encapsulated the query statement based on character string forms completely, and object-oriented, is good at execution dynamic queries, i.e. parameter query more.
The present invention is divided into back-end data inquiry and front end style configuration two parts by whole paging.Respectively data paging query and front end Pagination Display pattern are designed, then unify configuration.And condition map object and find data object and be Object object, realize paging for the versatility of various objects.Subordinate's way of reference of the present invention is for being encapsulated into the common code part of the query interface criteria paging query by Hibernate and implementation framework method in class, need to be by the class object access class that paging is shown, only need inherit such then to realize inheritance method and query argument map, number of pages and every page are recorded to number process and return to recording number and recording number of inquiring.The difference operation of carrying out when the present invention saves different Object Query paging, and make item code more succinct, framework is more clear, and front end paging changing style can be changed the pattern skin of paging according to demand.
Fig. 2 is a kind of process flow diagram based on the general paging query method of SSH framework of the present invention, and the method realizes by system as shown in Figure 1, and described method comprises the steps:
Step S201, Web front end carries out map encapsulation by querying condition, and sends to background server by the mode of submission of sheet.This step realizes by package module 11, submission module 12.
Step S202, background server carries out paging query by the query interface criteria of Hibernate, and Query Result is fed back to web front-end.This step realizes by the paging query module 21 of background server 20.
Step S203, front end style configuration is built Pagination Display basic framework by js customized label and struts2, judges that the selected pattern of Pagination Display shows when paging refreshes.This step realizes by leading portion style configuration module 13.
Preferably, step S02 also comprises: according to passed map condition, current page variable and every page, record number and inquire qualified record and record number.
Preferably, step S03 also comprises: front end is introduced selectable various css pattern files to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.
Fig. 3 is the process flow diagram that in an embodiment of the present invention, background server carries out paging query.This flow process comprises:
Step S301, obtains condition map, the page number and every page and records number.
Step S302, judges that whether data are effective.If enter step S303, otherwise get back to step S301.
Step S303, according to condition query data, and preserves map condition.After this step completes, if desired carry out the inquiry of lower one page and get back to step S301, if do not need the inquiry of lower one page to finish.
The present invention in project overall arrangement by spring at backstage injecting data query entity object, when needs are inquired about, the object directly use injecting, and Query Result is passed on the page.Spring is a kind of Open Framework of lightweight, and one of main advantage of framework is exactly its layer architecture, and layer architecture allows which assembly of user's choice for use, simultaneously for JavaEE application development provides integrated framework.Spring has proposed to rely on the thought of injecting, rely on class and can't help programmer's instantiation, but by Spring container help our new given instance and by example be injected into need to the class of this object in.Relying on the another kind of saying of injecting is " controlling reversion ", popular understanding is: example of we new usually, the control of this example is our programmer, and control reversion, refers to that the work of new example can't help we programmer and do but give spring container and do.The injection mode of Spring comprises the method injection of set injection, constructor injection, static factory, the method injection of Bean factory etc.
Certainly; the present invention also can have other various embodiments; in the situation that not deviating from spirit of the present invention and essence thereof; those of ordinary skill in the art are when making according to the present invention various corresponding changes and distortion, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.

Claims (8)

1. based on the general paging query method of SSH framework, it is characterized in that, described method comprises the steps:
Web front end carries out map encapsulation by querying condition, and sends to background server by the mode of submission of sheet;
Background server carries out paging query by the query interface criteria of Hibernate, and Query Result is fed back to web front-end;
Front end style configuration is built Pagination Display basic framework by js customized label and struts2, judges that the selected pattern of Pagination Display shows when paging refreshes.
2. method according to claim 1, it is characterized in that, the step that Web front end carries out map encapsulation by querying condition comprises: the paging parameter information that the web front-end page is used is stored in Map set with the form of key-value pair, and paging parameter information comprises: record sum, record number, the total page number of current page, every page of demonstration.
3. method according to claim 1, is characterized in that, the step of " background server carries out paging query by the query interface criteria of Hibernate " comprising:
According to passed map condition, current page variable and every page, recording number inquires qualified record and records number.
4. method according to claim 1, is characterized in that, the step of " front end style configuration is built Pagination Display basic framework by js customized label and struts2 " comprising:
Front end is introduced selectable various css pattern files to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.
5. based on the general paging query system of SSH framework, it is characterized in that, described system comprises web front-end and background server, and described web front-end comprises:
Package module, for carrying out map encapsulation by querying condition;
Submit module to, the mode by submission of sheet sends to background server by the querying condition after encapsulation;
Style configuration module, for building Pagination Display basic framework by js customized label and struts2, judges that when paging refreshes the selected pattern of Pagination Display shows,
Background server comprises paging query module, and its query interface criteria by Hibernate carries out paging query, and Query Result is fed back to web front-end.
6. system according to claim 5, it is characterized in that, described package module is also stored in Map set for paging parameter information that the web front-end page is used with the form of key-value pair, and paging parameter information comprises: record sum, record number, the total page number of current page, every page of demonstration.
7. system according to claim 5, is characterized in that, paging query module inquires qualified record and records number for recording number according to passed map condition, current page variable and every page.
8. system according to claim 5, is characterized in that, style configuration module is used for introducing selectable various css pattern file to show various styles, and the js file bag that has encapsulated paging displaying label is for selecting the pattern of front end paging.
CN201410203621.XA 2014-05-14 2014-05-14 General paging query method and system based on SSH framework Pending CN103984549A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410203621.XA CN103984549A (en) 2014-05-14 2014-05-14 General paging query method and system based on SSH framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410203621.XA CN103984549A (en) 2014-05-14 2014-05-14 General paging query method and system based on SSH framework

Publications (1)

Publication Number Publication Date
CN103984549A true CN103984549A (en) 2014-08-13

Family

ID=51276543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410203621.XA Pending CN103984549A (en) 2014-05-14 2014-05-14 General paging query method and system based on SSH framework

Country Status (1)

Country Link
CN (1) CN103984549A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104796754A (en) * 2015-04-08 2015-07-22 天脉聚源(北京)传媒科技有限公司 Collected page display method and collected page display device
CN105468355A (en) * 2015-11-13 2016-04-06 上海斐讯数据通信技术有限公司 Realizing method and system of WEB management platform in WVC (model, view, controller) mode
CN106528256A (en) * 2016-10-20 2017-03-22 国云科技股份有限公司 Java EJB (Enterprise Java Bean) platform based entity BEAN general query method
CN109634565A (en) * 2018-11-16 2019-04-16 华南理工大学 A method of electricity transaction settlement platform is built based on SSH frame
CN113886728A (en) * 2021-12-07 2022-01-04 中航金网(北京)电子商务有限公司 Method and device for displaying table data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289473A (en) * 2011-07-27 2011-12-21 迈普通信技术股份有限公司 Device and method for paging query of a plurality of servers
CN103425708A (en) * 2012-05-25 2013-12-04 金蝶软件(中国)有限公司 Optimized web paging query method and device
CN103678408A (en) * 2012-09-21 2014-03-26 阿里巴巴集团控股有限公司 Method and device for inquiring data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289473A (en) * 2011-07-27 2011-12-21 迈普通信技术股份有限公司 Device and method for paging query of a plurality of servers
CN103425708A (en) * 2012-05-25 2013-12-04 金蝶软件(中国)有限公司 Optimized web paging query method and device
CN103678408A (en) * 2012-09-21 2014-03-26 阿里巴巴集团控股有限公司 Method and device for inquiring data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
I_I001 等: ""下拉框如何控制页面数据显示条数"", 《HTTPS://BBS.CSDN.NET/TOPICS/290040116》 *
吴东庆 等: ""基于SSH架构的分页查询标签的研究与实现"", 《仲恺农业工程学院学报》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104796754A (en) * 2015-04-08 2015-07-22 天脉聚源(北京)传媒科技有限公司 Collected page display method and collected page display device
CN105468355A (en) * 2015-11-13 2016-04-06 上海斐讯数据通信技术有限公司 Realizing method and system of WEB management platform in WVC (model, view, controller) mode
CN105468355B (en) * 2015-11-13 2018-09-28 上海斐讯数据通信技术有限公司 Realization method and system of the WEB management platforms under MVC pattern
CN106528256A (en) * 2016-10-20 2017-03-22 国云科技股份有限公司 Java EJB (Enterprise Java Bean) platform based entity BEAN general query method
CN106528256B (en) * 2016-10-20 2019-06-21 国云科技股份有限公司 A kind of entity B EAN general polling method based on Java EJB platform
CN109634565A (en) * 2018-11-16 2019-04-16 华南理工大学 A method of electricity transaction settlement platform is built based on SSH frame
CN113886728A (en) * 2021-12-07 2022-01-04 中航金网(北京)电子商务有限公司 Method and device for displaying table data

Similar Documents

Publication Publication Date Title
CN102646038B (en) Control content display method, control content display device and mobile terminal
CN103984549A (en) General paging query method and system based on SSH framework
CN108153716B (en) Form processing method and device, storage medium and electronic equipment
CN105487864A (en) Method and device for automatically generating code
US8180795B2 (en) Apparatus and method for distribution of a report with dynamic write-back to a data source
CN105843609A (en) MVC frame based on Spring and MyBatis
CN108369591B (en) System and method for caching and parameterizing IR
CN103412868A (en) Method and device for generating document
CN101609531A (en) Data processing method in a kind of enterprise resource planning and device
CN104850627A (en) Method and apparatus for performing paging display
CN110221835A (en) Increase the method and device of control in front end page
CN101901262A (en) Object-oriented model-based enterprise database construction and service data display method
KR20200121744A (en) Method and device for processing user personal, server and storage medium
EP2602756A1 (en) Parallel processing of semantically grouped data in data warehouse environments
CN106462584B (en) The system and method for more inquiry Out-of-order executions in storing process
US8732655B2 (en) Systems and methods for metamodel transformation
US20190147088A1 (en) Reporting and data governance management
CN108874808A (en) A kind of page elements interlock method, device and server
CN104025087A (en) Method and system for data filing systems
EP2343658A1 (en) Federation as a process
US9280361B2 (en) Methods and systems for a real time transformation of declarative model and layout into interactive, digital, multi device forms
US11099721B2 (en) In-cell commands for matrix layout structured user interface
US8782090B2 (en) Aiding report construction based on inference of implicit application level relationships
CN102129468B (en) Method for displaying customizable cluster state
CA2839571A1 (en) Data driven synthesizer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140813

RJ01 Rejection of invention patent application after publication