Summary of the invention
The method and system that embodiments of the invention provide a kind of page to generate, need dynamically to use the JSP label to generate the problem of the page for solving page generative process.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of method that page generates comprises:
Client device sends the page-tag request message to server, and described page-tag request message carries label container sign and page-tag sign; Wherein, label container is designated the sign of label container, and described label container is for the corresponding relation between memory page tag identifier and page-tag information;
Described server, after receiving described page-tag request message, identifies in the page-tag information of storing corresponding label container from described label container, determines and identifies corresponding page-tag information with described page-tag;
Described server sends the page-tag request response to client device, and described page-tag request response carries described label container sign and described page-tag information;
Described client device, after receiving described page-tag request response, according to the page intrinsic information of described page-tag information and the page to be generated, generates the described page to be generated.
The system that a kind of page generates, comprising: client device and server;
Wherein, client device, for to server, sending the page-tag request message, described page-tag request message carries label container sign and page-tag sign; Wherein, label container is designated the sign of label container, and described label container is for the corresponding relation between memory page tag identifier and page-tag information; And, for after receiving described page-tag request response, according to the page intrinsic information of described page-tag information and the page to be generated, generate the described page to be generated;
Described server, for after receiving described page-tag request message, identify in the page-tag information of storing corresponding label container from described label container, determines and identify corresponding page-tag information with described page-tag; Send the page-tag request response to client device, described page-tag request response carries described label container sign and described page-tag information.
The method and system that the embodiment of the present invention provides a kind of page to generate, by label container is set in server, and storage generates the needed page-tag information of the page in label container, no matter be generate for the first time the page or modify at original page, the page-tag information that client device all can need to server request self, then be sent to client device by server by these information.Than the mode that can only update label information after changing for page info in prior art, solved the problem that can't dynamically use the JSP label to generate page elements, method than being only applicable to the modification configuration file of lowest version server in prior art, have stronger compatibility and extensibility.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making under the creative work prerequisite the every other embodiment obtained, belong to the scope of protection of the invention.
A kind of method that the embodiment of the present invention provides page to generate, as shown in Figure 1, idiographic flow comprises:
101, client device sends the page-tag request message to server, and described page-tag request message carries label container sign and page-tag sign.
Wherein, label container is designated the sign of label container, and described label container is for the corresponding relation between memory page tag identifier and page-tag information.Different label containers can be stored different corresponding relations.
Concrete, if the present invention is used under the JS application scenarios, label container can be used div(division, merogenesis) container realized, corresponding sign just can realize with being similar to letter, numeral or other identification informations commonly used.And page-tag refers to, be exactly the JSP label, and the page-tag sign can mean by the key-value pair of JSP tag identification code.Use the input frame label with JS in the div container that will to ask at id be a, so the form of this request message can use [{ containerId: " a ", JSpTag: "<c:input id=" tinput " text=" input frame "</c:input "] this example.
102, described server, after receiving described page-tag request message, identifies in the page-tag information of storing corresponding label container from described label container, determines and identifies corresponding page-tag information with described page-tag.
Concrete, if the present invention is used under the JS application scenarios, page-tag information refers to the concrete information such as program code of using of JSP page-tag.
103, described server sends the page-tag request response to client device, and described page-tag request response carries described label container sign and described page-tag information.
Wherein, the transformat of page-tag request response and page-tag request message are similar, so that the parsing between each equipment and generation.
104, described client device, after receiving described page-tag request response, according to the page intrinsic information of described page-tag information and the page to be generated, generates the described page to be generated.
Wherein, page intrinsic information refer to except page-tag information for generating the necessary information of the page, for example, page skeleton code, business module code etc.Page intrinsic information can be changeless code in the present embodiment, can be also the code that can change as required, and the present embodiment is not done special restriction to this.
A kind of method that the embodiment of the present invention provides page to generate, by label container is set in server, and storage generates the needed page-tag information of the page in label container, no matter be generate for the first time the page or modify at original page, the page-tag information that client device all can need to server request self, then be sent to client device by server by these information.Than the mode that can only update label information after changing for page info in prior art, solved the problem that can't dynamically use the JSP label to generate page elements, method than being only applicable to the modification configuration file of lowest version server in prior art, have stronger compatibility and extensibility.
Further, because the present invention has designed the label container for the memory page label, therefore, for client device, page-tag that need to determine own needs in which label container.Come from this, the embodiment of the present invention also provides corresponding realization flow, before execution and step 101, as shown in Figure 2, comprising:
105, described client device is determined the page-tag sign that the page to be generated is used.
In this step 105, client device can be selected the current page-tag that generates or revise that needs as required, then determines corresponding page-tag sign.
106, the page-tag sign that described client device is used according to the described page to be generated, from being stored in the page-tag sign and the corresponding relation that label container identifies in described client device, determine that the page-tag of using with the described page to be generated identifies corresponding label container sign.
Wherein, the corresponding relation of page-tag sign and label container sign is between client device and server, to consult in advance to be formed and stored in client device.Specifically needing which page-tag will be stored in which label container can be set according to actual needs, only need in the present embodiment to guarantee that page-tag sign and the normal foundation of the corresponding relation of label container sign get final product, do not limit the concrete mode of setting up.
Further, in order to facilitate the direct use of client device pair and page-tag, the embodiment of the present invention provides idiographic flow as shown in Figure 3 over against the realization of step 102, comprising:
1021, determine and identify corresponding tag identification code with described page-tag.
Due to the existence that label container is arranged, during the realizing of step 1021, only need to directly carry out directly being searched and getting final product in label container.
1022, described tag identification code is converted to page code, generates page-tag information.
What tag identification code described herein was used is the code of JSP label itself, page code be by the JSP tag identification code carry out formation after the programming language conversion for generating the program code of the page, such as HTML code etc.
Further, for convenient service device and client device for page-tag, obtain mutual, the embodiment of the present invention provides following method flow, specific as follows:
Following step has embodied step 103 client device and has sent the idiographic flow of page-tag request message to server, comprising:
If described page-tag request message only carries label container sign and a page-tag sign, described client device will described label container sign and a described page-tag identify to be placed on successively in same array and send to server.If described page-tag request message carries at least two label container signs and corresponding page-tag sign, described client device is placed on each label container sign and corresponding page-tag sign successively in same array and sends to server according to same order.
For example, if the page-tag request message carries label container sign 1 and page-tag sign a, this transmission of messages is to use array [label container sign 1, page-tag sign a] to mean.If the page-tag request message carries label container sign 1, page-tag sign a and label container sign 2, page-tag sign b, this transmission of messages is to use array [label container sign 1, page-tag sign a, label container sign 2, page-tag sign b] to mean.If there is more information just according to this order, to be connected serially to successively in same array and to get final product.Certainly this is an example, and concrete ability transformat also can arrange other form as required.
Following step has embodied step 104 server and has sent the idiographic flow of page-tag request response to client device, comprising:
If described page-tag request response only carries label container sign and a page-tag information, described client device will a described label container identifies and a described page-tag information is placed on successively in same array and sends to server; If described page-tag request response carries at least two label container signs and corresponding page-tag information, described client device is placed on each label container sign and corresponding page-tag information successively in same array and sends to server according to same order.
This transmission mode is identical with the transmission mode of page-tag request message, at this, seldom does description.
The system that the embodiment of the present invention also provides a kind of page to generate, as shown in Figure 4, comprising: client device 21 and server 22.
Wherein, client device 21, for to server 22, sending the page-tag request message, described page-tag request message carries label container sign and page-tag sign; Wherein, label container is designated the sign of label container, and described label container is for the corresponding relation between memory page tag identifier and page-tag information; And, for after receiving described page-tag request response, according to the page intrinsic information of described page-tag information and the page to be generated, generate the described page to be generated.
Described server 22, for after receiving described page-tag request message, identify in the page-tag information of storing corresponding label container from described label container, determines and identify corresponding page-tag information with described page-tag; Send the page-tag request response to client device 21, described page-tag request response carries described label container sign and described page-tag information.
Optionally, the described client device 21 page-tag sign for determining that the page to be generated is used also; The page-tag sign of using according to the described page to be generated, from being stored in the page-tag sign and the corresponding relation that label container identifies in described client device 21, determine that the page-tag of using with the described page to be generated identifies corresponding label container sign.
Optionally, described server 22 also identifies corresponding tag identification code for determining with described page-tag; Described tag identification code is converted to page code, generates page-tag information.
Optionally, if described client device 21 also only carries a label container sign and a page-tag sign for described page-tag request message, described client device 21 is placed in same array described label container sign and described page-tag sign successively to server 22 transmissions; If described page-tag request message carries at least two label container signs and corresponding page-tag sign, described client device 21 is placed on each label container sign and corresponding page-tag sign successively in same array and sends to server 22 according to same order.
Optionally, if described server 22 also only carries a label container sign and a page-tag information for described page-tag request response, described client device 21 is placed in same array described label container sign and a described page-tag information successively to server 22 transmissions; If described page-tag request response carries at least two label container signs and corresponding page-tag information, described client device 21 is placed on each label container sign and corresponding page-tag information successively in same array and sends to server 22 according to same order.
The system that the embodiment of the present invention provides a kind of page to generate, by label container is set in server, and storage generates the needed page-tag information of the page in label container, no matter be generate for the first time the page or modify at original page, the page-tag information that client device all can need to server request self, then be sent to client device by server by these information.Solved the problem that can't dynamically use the JSP label to generate page elements, the method than being only applicable to the modification configuration file of lowest version server in prior art, have stronger compatibility and extensibility.
Through the above description of the embodiments, the those skilled in the art can be well understood to the mode that the present invention can add essential common hardware by software and realize, can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium can read, floppy disk as computing machine, hard disk or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, or the network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.