CN111859236A - Server rendering page generation method and system based on dynamic form verification - Google Patents

Server rendering page generation method and system based on dynamic form verification Download PDF

Info

Publication number
CN111859236A
CN111859236A CN202010565892.5A CN202010565892A CN111859236A CN 111859236 A CN111859236 A CN 111859236A CN 202010565892 A CN202010565892 A CN 202010565892A CN 111859236 A CN111859236 A CN 111859236A
Authority
CN
China
Prior art keywords
data
server
verification
page
dynamic
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
CN202010565892.5A
Other languages
Chinese (zh)
Other versions
CN111859236B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010565892.5A priority Critical patent/CN111859236B/en
Publication of CN111859236A publication Critical patent/CN111859236A/en
Application granted granted Critical
Publication of CN111859236B publication Critical patent/CN111859236B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a server rendering page generation method and system based on dynamic form verification. Different from a common browser-side rendering mode, the method uses a server-side rendering mode, has the characteristics of SEO friendliness, quick response, less client resource occupation and the like, meets the form verification real-time feedback, and brings good interactive experience to users.

Description

Server rendering page generation method and system based on dynamic form verification
Technical Field
The invention relates to the technical field of software development, in particular to a method and a system for generating a server rendering page based on dynamic form verification.
Background
When a browser is used for accessing an internet site, data returned by a web page source and a requested site server can be divided into client rendering and server rendering according to the rendering mode of the web page. The most important difference between the two is who completes the complete splicing of the html file. If the rendering is finished at the server side and then returned to the client side, the rendering is performed by the server; and if the front end does more work and finishes the splicing of the html, rendering the client. The two rendering modes are different in different service scenes, the user interaction experience is improved aiming at the situation that the front end and the rear end are required to be separately developed, more form input exists in service requirements and the form verification result is required to be fed back in real time, and the client rendering advantages are obvious. If requirements for SEO (Search Engine Optimization) are high, the service scene with high response speed is provided, and the advantages of server-side rendering are very obvious. If SEO friendliness is required, more form data processing exists, and real-time feedback is required while legality of contents input by a user is checked, a large amount of repeated form definition and input checking work must be performed on the basis of server-side rendering.
Disclosure of Invention
The invention aims to provide a server rendering page generation method and system based on dynamic form verification, aims to solve the problems of form definition and repeated input verification in server side rendering in the prior art, realizes SEO friendliness, quick response and less client side resource occupation, and simultaneously meets the requirement of real-time feedback of form verification.
In order to achieve the technical purpose, the invention provides a server rendering page generation method based on dynamic form verification, which comprises the following operations:
a browser initiates a request, and acquires a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence by combining form definition;
binding a corresponding form verification rule for the generated form according to the acquired dynamic form data, and providing validity check for user input;
judging whether background data needs to be requested or not, if yes, sending an http request to a background server, analyzing data returned by the background server, and filling the data into a form corresponding to an html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
Preferably, the html page template defines frame elements of a page to be generated; the form definition content comprises a form name, a type, form attributes and initial data, wherein the initial data supports incoming specified data and also supports acquisition from a background server through an http request.
Preferably, the form validation rules include a rule that cannot be blank, date format, mailbox format, cell phone number format, and input character limit.
The invention also provides a system for generating the rendered page of the server based on the verification of the dynamic form, which comprises the following steps:
the template and form acquisition module is used for initiating a request by a browser and acquiring a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
the form insertion module is used for inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence in combination with the form definition;
the form verification module is used for binding a corresponding form verification rule for the generated form according to the acquired dynamic form data and providing validity verification for user input;
the page generation module is used for judging whether background data needs to be requested or not, if the http request needs to be sent to the background server, analyzing the data returned by the background server, and filling the data into a form corresponding to the html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
Preferably, the html page template defines frame elements of a page to be generated; the form definition content comprises a form name, a type, form attributes and initial data, wherein the initial data supports incoming specified data and also supports acquisition from a background server through an http request.
Preferably, the form validation rules include a rule that cannot be blank, date format, mailbox format, cell phone number format, and input character limit.
The invention also provides a server rendering page generation device based on the dynamic form verification, which comprises the following steps:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the server rendering page generation method based on the dynamic form verification.
The invention also provides a readable storage medium for storing a computer program, wherein the computer program is used for realizing the method for generating the server rendering page based on the dynamic form verification when being executed by a processor.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
Compared with the prior art, the method and the system have the advantages that the user request is forwarded through the route through the configuration of the predefined route forwarding rule, the html template file, the dynamic form definition, the form verification rule and the like, the user request data is analyzed, the rendering of the page file accessed by the user request is completed at the server side, and the page file is finally output to the browser for the user to use. Different from a common browser-side rendering mode, the method uses a server-side rendering mode, has the characteristics of SEO friendliness, quick response, less client resource occupation and the like, meets the form verification real-time feedback, and brings good interactive experience to users.
Drawings
Fig. 1 is a flowchart of a method for generating a rendered page of a server based on dynamic form verification according to an embodiment of the present invention;
fig. 2 is a block diagram of a system for generating a server rendered page based on dynamic form verification according to an embodiment of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
The following describes a method and a system for generating a server rendered page based on dynamic form verification according to an embodiment of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, the present invention discloses a method for generating a server rendered page based on dynamic form verification, which includes the following operations:
a browser initiates a request, and acquires a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence by combining form definition;
binding a corresponding form verification rule for the generated form according to the acquired dynamic form data, and providing validity check for user input;
judging whether background data needs to be requested or not, if yes, sending an http request to a background server, analyzing data returned by the background server, and filling the data into a form corresponding to an html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
Predefining a routing rule, and when a user initiates a request at a browser end, acquiring data such as a corresponding html page template type, a dynamic form type object array and the like according to a URL (uniform resource locator) path requested by the user in the routing rule.
The system is internally provided with a plurality of html templates, the html templates are stored in a designated folder of a server side, the html templates define frame elements of pages needing to be generated, and the types of the html templates are matched according to routing rules. And the process of reading the built-in html template file is completed by automatically inquiring the html template file under the appointed folder.
In addition, various form definitions are built in, including an input box, a pull-down selection box, a radio box, a check box, a date selection box and the like, a dynamic form type object array is obtained according to a routing rule, and the forms are inserted into the specified positions of the template files in a fixed sequence by combining the obtained html template files. The form definition content comprises a form name, a type, form attributes, initial data and the like, wherein the initial data supports the transmission of specified data and supports the acquisition from a background server through an http request.
Setting a plurality of form validation rules, including the conditions that the forms cannot be blank, date format, mailbox format, mobile phone number format, input character limitation and the like, binding the corresponding validation rules for the generated forms according to the acquired dynamic form data, and providing real-time validity check feedback for user input.
Judging whether background data needs to be requested according to the acquired html template file and the dynamic form data, sending a specified http request to a background server, analyzing data returned by the background server, filling data needing to be displayed to a user into a form corresponding to the html template, generating a complete html page, and returning the complete html page to the browser if the background data needs to be requested; and if the background data does not need to be requested, directly returning the assembled html page to the browser, thereby completing the process of rendering and generating the page at the server side.
The embodiment of the invention forwards the user request through the route by the configuration of the predefined route forwarding rule, the html template file, the dynamic form definition, the form verification rule and the like, analyzes the user request data, completes the rendering of the page file accessed by the user request at the server end, and finally outputs the page file to the browser for the user to use. Different from a common browser-side rendering mode, the method uses a server-side rendering mode, has the characteristics of SEO friendliness, quick response, less client resource occupation and the like, meets the form verification real-time feedback, and brings good interactive experience to users.
As shown in fig. 2, an embodiment of the present invention further discloses a system for generating a server rendered page based on dynamic form verification, where the system includes:
the template and form acquisition module is used for initiating a request by a browser and acquiring a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
the form insertion module is used for inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence in combination with the form definition;
the form verification module is used for binding a corresponding form verification rule for the generated form according to the acquired dynamic form data and providing validity verification for user input;
The page generation module is used for judging whether background data needs to be requested or not, if the http request needs to be sent to the background server, analyzing the data returned by the background server, and filling the data into a form corresponding to the html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
Predefining a routing rule, and when a user initiates a request at a browser end, acquiring data such as a corresponding html page template type, a dynamic form type object array and the like according to a URL (uniform resource locator) path requested by the user in the routing rule.
The system is internally provided with a plurality of html templates, the html templates are stored in a designated folder of a server side, the html templates define frame elements of pages needing to be generated, and the types of the html templates are matched according to routing rules. And the process of reading the built-in html template file is completed by automatically inquiring the html template file under the appointed folder.
In addition, various form definitions are built in, including an input box, a pull-down selection box, a radio box, a check box, a date selection box and the like, a dynamic form type object array is obtained according to a routing rule, and the forms are inserted into the specified positions of the template files in a fixed sequence by combining the obtained html template files. The form definition content comprises a form name, a type, form attributes, initial data and the like, wherein the initial data supports the transmission of specified data and supports the acquisition from a background server through an http request.
Setting a plurality of form validation rules, including the conditions that the forms cannot be blank, date format, mailbox format, mobile phone number format, input character limitation and the like, binding the corresponding validation rules for the generated forms according to the acquired dynamic form data, and providing real-time validity check feedback for user input.
Judging whether background data needs to be requested according to the acquired html template file and the dynamic form data, sending a specified http request to a background server, analyzing data returned by the background server, filling data needing to be displayed to a user into a form corresponding to the html template, generating a complete html page, and returning the complete html page to the browser if the background data needs to be requested; and if the background data does not need to be requested, directly returning the assembled html page to the browser, thereby completing the process of rendering and generating the page at the server side.
The embodiment of the invention also discloses a server rendering page generating device based on the dynamic form verification, which comprises the following steps:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the server rendering page generation method based on the dynamic form verification.
The embodiment of the invention also discloses a readable storage medium for storing a computer program, wherein the computer program realizes the method for generating the server rendering page based on the dynamic form verification when being executed by a processor.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (8)

1. A method for generating a server rendering page based on dynamic form verification is characterized by comprising the following operations:
a browser initiates a request, and acquires a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence by combining form definition;
binding a corresponding form verification rule for the generated form according to the acquired dynamic form data, and providing validity check for user input;
judging whether background data needs to be requested or not, if yes, sending an http request to a background server, analyzing data returned by the background server, and filling the data into a form corresponding to an html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
2. The method for generating the server rendering page based on the dynamic form verification as claimed in claim 1, wherein the html page template defines frame elements of a page to be generated; the form definition content comprises a form name, a type, form attributes and initial data, wherein the initial data supports incoming specified data and also supports acquisition from a background server through an http request.
3. The method of claim 1, wherein the form validation rules include a rule that cannot be blank, date format, mailbox format, cell phone number format, and input character limit.
4. A system for generating a server rendered page based on dynamic form verification, the system comprising:
the template and form acquisition module is used for initiating a request by a browser and acquiring a corresponding html page template type and a dynamic form type object array according to a predefined routing rule;
the form insertion module is used for inserting the dynamic form data into the appointed position of the html page template file in a fixed sequence in combination with the form definition;
the form verification module is used for binding a corresponding form verification rule for the generated form according to the acquired dynamic form data and providing validity verification for user input;
the page generation module is used for judging whether background data needs to be requested or not, if the http request needs to be sent to the background server, analyzing the data returned by the background server, and filling the data into a form corresponding to the html page template to generate a complete html page; otherwise, directly returning to the assembled html page.
5. The system for generating server rendering pages based on dynamic form verification of claim 4, wherein the html page template defines frame elements of a page to be generated; the form definition content comprises a form name, a type, form attributes and initial data, wherein the initial data supports incoming specified data and also supports acquisition from a background server through an http request.
6. The system of claim 4, wherein the form validation rules include a failure to be blank, a date format, a mailbox format, a cell phone number format, and an input character limit.
7. A server rendering page generation device based on dynamic form verification is characterized by comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the method for server rendered page generation based on dynamic form verification according to any of claims 1-3.
8. A readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method for generating a server rendered page based on dynamic form verification according to any one of claims 1-3.
CN202010565892.5A 2020-06-19 2020-06-19 Server rendering page generation method and system based on dynamic form verification Active CN111859236B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010565892.5A CN111859236B (en) 2020-06-19 2020-06-19 Server rendering page generation method and system based on dynamic form verification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010565892.5A CN111859236B (en) 2020-06-19 2020-06-19 Server rendering page generation method and system based on dynamic form verification

Publications (2)

Publication Number Publication Date
CN111859236A true CN111859236A (en) 2020-10-30
CN111859236B CN111859236B (en) 2022-07-08

Family

ID=72986985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010565892.5A Active CN111859236B (en) 2020-06-19 2020-06-19 Server rendering page generation method and system based on dynamic form verification

Country Status (1)

Country Link
CN (1) CN111859236B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112465620A (en) * 2020-12-30 2021-03-09 广东金赋科技股份有限公司 Terminal form filling service linkage method and device based on dynamic form and rule engine
CN112464070A (en) * 2020-11-25 2021-03-09 银盛通信有限公司 Vue-based form configuration method, system, computer equipment and storage medium
CN112882707A (en) * 2021-03-09 2021-06-01 成都新希望金融信息有限公司 Rendering method, rendering device, storage medium and electronic equipment
CN113010827A (en) * 2021-03-16 2021-06-22 北京百度网讯科技有限公司 Page rendering method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182547A (en) * 2014-09-10 2014-12-03 北京浩瀚深度信息技术股份有限公司 Method for optimizing page rendering of server and web cache server
CN109324788A (en) * 2018-09-05 2019-02-12 湖南华诺科技有限公司 A kind of server-side rendering method based on React and Nodejs
CN110096659A (en) * 2019-03-27 2019-08-06 北京三快在线科技有限公司 A kind of page display method, device, equipment and readable storage medium storing program for executing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182547A (en) * 2014-09-10 2014-12-03 北京浩瀚深度信息技术股份有限公司 Method for optimizing page rendering of server and web cache server
CN109324788A (en) * 2018-09-05 2019-02-12 湖南华诺科技有限公司 A kind of server-side rendering method based on React and Nodejs
CN110096659A (en) * 2019-03-27 2019-08-06 北京三快在线科技有限公司 A kind of page display method, device, equipment and readable storage medium storing program for executing

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112464070A (en) * 2020-11-25 2021-03-09 银盛通信有限公司 Vue-based form configuration method, system, computer equipment and storage medium
CN112465620A (en) * 2020-12-30 2021-03-09 广东金赋科技股份有限公司 Terminal form filling service linkage method and device based on dynamic form and rule engine
CN112465620B (en) * 2020-12-30 2023-12-19 广东金赋科技股份有限公司 Terminal form filling service linkage method and device based on dynamic form and rule engine
CN112882707A (en) * 2021-03-09 2021-06-01 成都新希望金融信息有限公司 Rendering method, rendering device, storage medium and electronic equipment
CN112882707B (en) * 2021-03-09 2024-02-09 成都新希望金融信息有限公司 Rendering method and device, storage medium and electronic equipment
CN113010827A (en) * 2021-03-16 2021-06-22 北京百度网讯科技有限公司 Page rendering method and device, electronic equipment and storage medium
CN113010827B (en) * 2021-03-16 2024-03-22 北京百度网讯科技有限公司 Page rendering method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111859236B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
CN111859236B (en) Server rendering page generation method and system based on dynamic form verification
US6941512B2 (en) Dynamic web content unfolding in wireless information gateways
CN111782330B (en) Page data acquisition method, device and equipment based on Web application
US7886218B2 (en) Methods and devices for post processing rendered web pages and handling requests of post processed web pages
CN107872484B (en) REST API rapid registration method, device and system
KR101908162B1 (en) Live browser tooling in an integrated development environment
US20100218077A1 (en) Modifying a markup language document which includes a clickable image
CN106897251B (en) Rich text display method and device
CN103428243A (en) Implementation method, device and system for static storage of dynamic webpage
US20140136937A1 (en) Providing and procuring worksheet functions through an online marketplace
WO2011050368A1 (en) Configurable and dynamic transformation of web content
CN109815430B (en) Request processing method and device, data processing server and readable storage medium
CN111104587A (en) Webpage display method and device and server
CN103365865A (en) Methods and devices for storing and downloading data
US9971636B2 (en) Methods for implementing web services and devices thereof
CN106062741B (en) Method and system for information processing in social network system
CN104063401A (en) Webpage style address merging method and device
CN106790276A (en) A kind of browser-cross data interactive method and device based on browser protocol
CN110941950A (en) Interface document generation method, device, server and storage medium
US7272786B1 (en) Metadata, models, visualization and control
US8112500B2 (en) Technique of relaying communications between client apparatus and server apparatus
CN103914293A (en) Page generation method and server
US20100191766A1 (en) Method and apparatus for information retrieval via electronic mail
CN101815064A (en) Data interaction method and device thereof
CN110874278A (en) Embedding method of external system, workflow system, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant