Content of the invention
Embodiments of the invention provide the method and system that a kind of page generates, for solving to need in page generating process
Jsp label is dynamically used to generate the problem of the page.
For reaching above-mentioned purpose, embodiments of the invention adopt the following technical scheme that
A kind of method that page generates, comprising:
Client device sends page-tag request message to server, and described page-tag request message carries label
Container identification and page-tag mark;Wherein, label container is designated the mark of label container, and described label container is used for depositing
Corresponding relation between storage page-tag mark and page-tag information;
Described server, after receiving described page-tag request message, identifies corresponding label from described label container
In the page-tag information of storage in container, determine and identify corresponding page-tag information with described page-tag;
Described server sends page-tag request response to client device, and described page-tag request response disappears
Breath carries described label container mark and described page-tag information;
Described client device, after receiving described page-tag request response, is believed according to described page-tag
Breath and the page intrinsic information of the page to be generated, generate the described page to be generated.
A kind of system that page generates, comprising: client device server;
Wherein, client device, for sending page-tag request message, described page-tag request message to server
Carry label container mark and page-tag mark;Wherein, label container is designated the mark of label container, described label
Container is used for the corresponding relation between memory page tag identifier and page-tag information;And, for receiving described page
After the tag request response message of face, 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, identifying from described label container and corresponding to
Label container in storage page-tag information in, determine with described page-tag mark corresponding page-tag information;To
Client device sends page-tag request response, and described page-tag request response carries described label container
Mark and described page-tag information.
Embodiments provide the method and system that a kind of page generates, held by arranging label in the server
Device, and in label container, storage generates the page-tag information required for the page, either generates the page for the first time still former
The page is had to modify, the page-tag information that client device all can need to server request itself, then by server
These information are sent to client device.Label can only be updated compared in prior art for after page info change
For the mode of information, solve the problems, such as dynamically to generate page elements using jsp label, compared in prior art
The method being applied to the modification configuration file of lowest version server, has higher compatibility and extensibility.
Specific 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 carried out clear, complete
Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work
Embodiment, broadly falls into the scope of protection of the invention.
Embodiments provide a kind of method that page generates, as shown in figure 1, idiographic flow includes:
101st, client device sends page-tag request message to server, and described page-tag request message carries
Label container mark and page-tag mark.
Wherein, label container is designated the mark of label container, described label container be used for memory page tag identifier with
Corresponding relation between page-tag information.Different label containers can store different corresponding relations.
Specifically, if the present invention is used under js application scenarios, label container can use div (division, point Section) being realized, corresponding mark can be with using similar to letter, numeral or other conventional identification informations in fact for container Existing.And page-tag refers to is exactly jsp label, and page-tag mark can be represented by the key-value pair of jsp tag identification code. Then to ask in the div container for a for the id with js using input box label, then the form of this request message can use [containerid: " a ", jsptag: "<c:input id="tinput"text="Input box"></c:input>"] this Example.
102nd, described server, after receiving described page-tag request message, identifies corresponding from described label container
In the page-tag information of storage in label container, determine and identify corresponding page-tag information with described page-tag.
Specifically, if the present invention is used under js application scenarios, page-tag information refers to that jsp page-tag specifically makes
The information such as program code.
103rd, described server sends page-tag request response to client device, and described page-tag request rings
Message is answered to carry described label container mark and described page-tag information.
Wherein, the transformat of page-tag request response is similar with page-tag request message, so that each sets
Parsing between standby and generation.
104th, described client device is after receiving described page-tag request response, according to described page mark
The page intrinsic information of label information and the page to be generated, generates the described page to be generated.
Wherein, page intrinsic information refer in addition to page-tag information for generating information necessary to the page,
For example, page framework code, business module code etc..Page intrinsic information can be changeless generation in the present embodiment
Code or the code that can change as needed, the present embodiment is not particularly limited to this.
Embodiments provide a kind of method that page generates, by arranging label container in the server, and
In label container, storage generates the page-tag information required for the page, either generates the page for the first time and still enters in original page
Row modification, the page-tag information that client device all can need to server request itself, then by server, these are believed
Breath sends to client device.Compared to the side that can only update label information for page info after changing in prior art
For formula, solve the problems, such as dynamically to generate page elements using jsp label, low compared to being only applicable in prior art
The method of the modification configuration file of version server, has higher compatibility and extensibility.
Further, because the present invention devises the label container for memory page label, therefore, client is set
For standby it is thus necessary to determine that the page-tag oneself needing in which label container.Come from this, the embodiment of the present invention also carries
Supply to realize accordingly flow process, execution and step 101 are before as shown in Figure 2, comprising:
105th, described client device determines the page-tag mark that the page to be generated is used.
In this step 105, client device can select the page-tag being currently needed for generating or changing as needed,
It is then determined that corresponding page-tag mark.
106th, described client device identifies according to the page-tag that the described page to be generated is used, described from being stored in
Page-tag mark in client device and the corresponding relation of label container mark, are determined and are used with the described page to be generated
The corresponding label container mark of page-tag mark.
Wherein, page-tag mark with label container mark corresponding relation be in advance by client device server it
Between consult to be formed and stored in client device.Specifically needing which page-tag will be stored in can in which label container
To be set according to actual needs, only need in the present embodiment ensure that page-tag mark is corresponding with label container mark
Normally setting up of relation, does not limit mode of specifically setting up.
Further, the direct use of client device pair and page-tag for convenience, the embodiment of the present invention is just to step
Rapid 102 realization provides idiographic flow as shown in Figure 3, comprising:
1021st, determine and identify corresponding tag identification code with described page-tag.
Due to there being a presence of label container, step 1021 when realizing it is only necessary to directly carry out in label container directly
Make a look up.
1022nd, described tag identification code is converted to page code, generates page-tag information.
Tag identification code described herein uses the jsp label code of itself, and page code is then by jsp label generation
The program code for generating the page that code is formed after being programmed language conversion, such as html code etc..
Further, server and client side's equipment is directed to the interaction that page-tag obtains for convenience, and the present invention is implemented
Example provides following method flow, specific as follows:
Following step embodies the concrete stream that step 103 client device sends page-tag request message to server
Journey, comprising:
If described page-tag request message only carries a label container mark and a page-tag mark,
One label container mark and one page-tag mark are placed sequentially in same array by described client device
Middle to server transmission.If described page-tag request message carries at least two label container marks and the corresponding page
Tag identifier, then each label container is identified by described client device and corresponding page-tag identifies according to same order
It is placed sequentially in same array and send to server.
For example, if page-tag request message carries label container mark 1 and page-tag mark a, this message passes
Defeated is can be represented using array [label container mark 1, page-tag mark a].If page-tag request message carries mark
Sign container identification 1, page-tag mark a and label container mark 2, page-tag mark b, then this message transmission is to use
Array [label container mark 1, page-tag mark a, label container mark 2, page-tag mark b] is representing.If having more
Information be just sequentially sequentially connected in series to same array according to this.Certainly this is an example, specifically just passes
Transport format can also be arranged as required to other forms.
Following step embodies step 104 server and sends the concrete of page-tag request response to client device
Flow process, comprising:
If described page-tag request response only carries a label container mark and a page-tag letter
Breath, then described client device by one label container mark and one page-tag information be placed sequentially in same
Send to server in array;If described page-tag request response carries at least two label container marks and phase
The page-tag information answered, then described client device by each label container mark and corresponding page-tag information according to
Same order is placed sequentially in same array and sends to server.
This transmission means is identical with the transmission means of page-tag request message, and here is seldom described.
The embodiment of the present invention additionally provides the system that a kind of page generates, as shown in Figure 4, comprising: client device 21 He
Server 22.
Wherein, client device 21, for sending page-tag request message, described page-tag request to server 22
Message carries label container mark and page-tag mark;Wherein, label container is designated the mark of label container, described
Label container is used for the corresponding relation between memory page tag identifier and page-tag information;And, for receiving
After stating 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, it is right to identify from described label container
In the page-tag information of storage in the label container answered, determine and identify corresponding page-tag information with described page-tag;
Send page-tag request response to client device 21, described page-tag request response carries described label
Container identification and described page-tag information.
Optionally, described client device 21 is additionally operable to determine the page-tag mark that the page to be generated is used;Root
Identify according to the page-tag that the described page to be generated is used, from the page-tag mark being stored in described client device 21
With the corresponding relation of label container mark, determine the corresponding label of the page-tag mark being used with the described page to be generated
Container identification.
Optionally, described server 22 is additionally operable to determine and identifies corresponding tag identification code with described page-tag;By institute
State tag identification code and be converted to page code, generate page-tag information.
Optionally, if described client device 21 is additionally operable to described page-tag request message and only carries a label
Container identification and a page-tag identify, then one label container is identified and described one by described client device 21
Individual page-tag mark is placed sequentially in same array and sends to server 22;If described page-tag request message carries
At least two label containers marks and corresponding page-tag mark, then described client device 21 is by each label container mark
Know and corresponding page-tag mark is placed sequentially in same array according to same order and sends to server 22.
Optionally, if described server 22 is additionally operable to described page-tag request response and only carries a label
Container identification and a page-tag information, then described client device 21 by one label container mark and described one
Individual page-tag information is placed sequentially in same array and sends to server 22;If described page-tag request response is taken
Identify with least two label containers and corresponding page-tag information, then each label is held by described client device 21
Device mark and corresponding page-tag information are placed sequentially in same array according to same order and send to server 22.
Embodiments provide the system that a kind of page generates, by arranging label container in the server, and
In label container, storage generates the page-tag information required for the page, either generates the page for the first time and still enters in original page
Row modification, the page-tag information that client device all can need to server request itself, then by server, these are believed
Breath sends to client device.Solve the problems, such as dynamically to generate page elements using jsp label, compared to prior art
In be only applicable to lowest version server modification configuration file method, there is higher compatibility and extensibility.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can borrow
Help software to add the mode of necessary common hardware to realize naturally it is also possible to pass through hardware, but the former is more preferably in many cases
Embodiment.Based on such understanding, the portion that technical scheme substantially contributes to prior art in other words
Divide and can be embodied in the form of software product, this computer software product is stored in the storage medium that can read, such as count
The floppy disk of calculation machine, hard disk or CD etc., including some instructions with so that computer equipment (can be personal computer,
Server, or the network equipment etc.) method described in execution each embodiment of the present invention.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, and any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all should contain
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be defined by described scope of the claims.