The content of the invention
The present invention provides a kind of pseudo- static Web page generation method and device, using the advantage of pure static Web page,
Increase corresponding logic on backstage, so that while the information of user's typing pre-acquiring, foreground generation is pure
The static page.Pseudo- static Web page had both had the advantages that pure static Web page was easy to searched engine and included,
Again there is dynamic web page to carry out data maintenance to update the excellent of web page contents at any time by background data base
Point.
The present invention provides a kind of pseudo- static Web page generation method, including:
Receive web-page requests message, the acquisition approach information from the web-page requests message;
The routing information is parsed, program logo, contribution mark is obtained;Wherein, each program logo institute
Include the corresponding contribution of at least one contribution mark in corresponding column;
Identified according to the program logo and contribution, judge whether the response of the web-page requests message corresponds to
Pseudo- static Web page;
If so, obtaining column template corresponding with the program logo in background data base;
Identified, extracted and the corresponding contribution of contribution mark in background data base according to the contribution;
Column template corresponding with the program logo will be filled in the corresponding contribution of contribution mark
In, form pseudo- static Web page and presented to user.
Optionally, it is described to be identified according to the program logo and contribution, judge the web-page requests message
The whether corresponding pseudo- static Web page of response includes:
Corresponding first column of the program logo is found in background data base according to the program logo
Attribute information;The contribution mark corresponding first is found in background data base according to contribution mark
The attribute information of contribution;
If the attribute information of the attribute information of first column and first contribution both corresponds to non-outside
Link, it is determined that the response of the web-page requests message corresponds to pseudo- static Web page.
Optionally, it is described that the program logo correspondence is found in background data base according to the program logo
The first column attribute information;The contribution mark is found in background data base according to contribution mark
After the attribute information for knowing corresponding first contribution, in addition to:
If the attribute information of the attribute information of first column and/or first contribution corresponds to outside
Chained address, then according to the external linkage address, be presented the external linkage address corresponding to user
Web page contents.
Optionally, in addition to:
The priority of the external linkage address is higher than the priority of the non-external linkage.
Optionally, it is described will be identified with the contribution corresponding contribution be filled in it is corresponding with the program logo
Column template include:
Using FreeMarker template engines, in background server, the contribution is identified into corresponding original text
Part is filled in column template corresponding with the program logo, generates the input text of the pseudo- static Web page
This, so that user browser receives the pseudo- static Web page corresponding to the input text of the pseudo- static Web page.
The present invention also provides a kind of pseudo- static Web page generating means, including:
Receiving module, for receiving web-page requests message, acquisition approach is believed from the web-page requests message
Breath;
Parsing module, for parsing the routing information, obtains program logo, contribution mark;Wherein,
Include the corresponding contribution of at least one contribution mark in column corresponding to each program logo;
Judge module, for according to the program logo and contribution mark, judging the web-page requests message
The whether corresponding pseudo- static Web page of response;
Acquisition module, for judging that the response correspondence of the web-page requests message is pseudo- according to the judge module
During static Web page, column template corresponding with the program logo is obtained in background data base;
Extraction module, for being identified according to the contribution, is extracted and the contribution mark in background data base
Know corresponding contribution;
Module is formed, for that will be filled in and the program logo pair with the corresponding contribution of contribution mark
In the column template answered, form pseudo- static Web page and presented to user.
Optionally, the judge module, specifically for being looked for according to the program logo in background data base
To the attribute information of corresponding first column of the program logo;According to contribution mark in back-end data
The attribute information that the contribution identifies corresponding first contribution is found in storehouse;If the attribute of first column
Information and the attribute information of first contribution both correspond to non-external linkage, it is determined that the web-page requests
The response of message corresponds to pseudo- static Web page.
Optionally, described device also includes:Calling module, for when the attribute information of first column
And/or the attribute information of first contribution corresponds to external linkage address, then it is grounded according to the outer chains
Location, the corresponding web page contents in the external linkage address are presented to user.
Optionally, described device also includes:The priority of the external linkage address is higher than the non-outside
The priority of link.
Optionally, the formation module, specifically for using FreeMarker template engines, in backstage clothes
It is engaged in device, the contribution is identified into corresponding contribution is filled in column template corresponding with the program logo
In, the input text of the pseudo- static Web page is generated, so that user browser receives the pseudo- static network
Pseudo- static Web page corresponding to the input text of page.
Pseudo- static Web page generation method and device that the present invention is provided, by receiving web-page requests message,
The acquisition approach information from web-page requests message;Resolution path information, obtains program logo, contribution mark
Know;Wherein, at least one contribution mark is included in the column corresponding to each program logo corresponding
Contribution;Identified according to program logo and contribution, judge the whether corresponding puppet of response of web-page requests message
Static Web page;If so, obtaining column template corresponding with program logo in background data base;According to
Contribution is identified, and is extracted and the corresponding contribution of contribution mark in background data base;Will be with contribution mark pair
The contribution answered is filled in column template corresponding with program logo, is formed pseudo- static Web page and is in user
It is existing.So as to by storing column template, contribution data in background server, be asked according to user
URL parsing, is at any time matched contribution with corresponding column template on backstage, and in foreground net
Site server is formed in the pseudo- static Web page shown to user, the True Data for realizing pseudo- static Web page
Appearance is stored in background data base, consequently facilitating Dynamic Maintenance to data and to the timely of data content
Update;Meanwhile, webpage is shown in pseudo- static Web page form on foreground, there is pseudo- static Web page pure quiet
State webpage is easy to searched engine retrieval, the advantage included.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with this hair
Bright embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described.Need explanation
, in accompanying drawing or specification, similar or identical element all uses identical reference.
Figure 1A is the flow chart of the embodiment one of the pseudo- static Web page generation method of the present invention, as shown in Figure 1A,
Pseudo- static Web page generation method, including:
Step 101, reception web-page requests message, the acquisition approach information from web-page requests message.
Specifically, being mostly to be entered into database, foreground exhibition using backstage in current main stream website
The mode shown.In order to which using the advantage of pure static page, corresponding logic, Yong Hulu can be increased on backstage
Pure static webpage is generated while entering.The website of user profile, this side are not needed for front page layout
Formula is feasible.But, the front page layout of some websites, it is desirable to have the information such as User logs in, this part
Content can not be generated in advance static page to solve.In such a scenario, the place of pseudo- static is employed
Reason mode.Pseudo- static both webpage URLs (Uniform Resource Locator, abbreviation:
" URL ") rewrite, incoming web-page requests message is exactly intercepted, and redirect requests to other automatically
URL process, its purpose is mainly the parameter realized by the method for rewriteeing URL and remove dynamic web page,
Advantageously including in search engine.The URL rewrite process is firstly the need of in the web-page requests message
Get original URL routing informations.
Step 102, resolution path information, obtain program logo, contribution mark.
Specifically, it is corresponding each to include at least one contribution mark in the column corresponding to program logo
Contribution.Include in the background server of the pseudo- static Web page of generation, the pseudo- static Web page prestored
In homepage, each column subpage (for example:The programme orientations such as news, physical culture, amusement) and
The contents such as the details content (corresponding specific contribution content in each column) in each subpage.Foreground net
Only be stored with the structural framing of virtual pseudo- static Web page in site server, and the content in framework needs
It is identified to according to the program logo obtained by resolution path information, contribution in the database on backstage and carries out essence
The acquisition of content.
Step 103, identified according to program logo and contribution, judge whether the response of web-page requests message is right
Should pseudo- static Web page.
Specifically, finding the attribute information of corresponding with program logo and contribution mark column and contribution, belong to
Property information in include the attribute specification that pseudo- static Web page whether is generated to column template and contribution, or bag
Identify whether to correspond to the attribute specification of external linkage file containing the program logo and/or contribution.Above it is situated between
The pseudo- static Web page that continued is provided simultaneously with the display effect of static Web page and the back-end data of dynamic web page safeguards special
Property, therefore, as shown in Figure 1B, if selected contribution static option, generated for the contribution corresponding
Pseudo- static Web page, Website server shows the contribution with static Web page;If selected enable external linkage, and
The address information into external linkage is filled in, then the contribution being somebody's turn to do in " resource center " column will be with outer chains
The form connect shows that the webpage associated by the external linkage is probably other static Web pages or dynamic web page.
If the pseudo- static Web page of response correspondence of step 104, web-page requests message, is obtained in background data base
Take column template corresponding with program logo.
Step 105, identified according to contribution, extracted and the corresponding contribution of contribution mark in background data base.
Specifically, the column template file corresponding to program logo, as shown in following procedure, according to difference
Mark (id numbers) obtain corresponding column template, and get the contribution list information in the column.
In fact, backstage prestores program logo and the mapping table of all contributions mark included in it,
The corresponding column of user's request URL and contribution content are obtained by the table.
Step 106, column template corresponding with program logo will be filled in the corresponding contribution of contribution mark
In, form pseudo- static Web page and presented to user.
Specifically, using FreeMarker template engines, in background server, contribution is identified into correspondence
Contribution be filled in column template corresponding with program logo, the input text of the pseudo- static Web page of generation,
So that user browser receives the pseudo- static Web page corresponding to the input text of pseudo- static Web page.
Wherein, Freemarker view resolver configuration can be as shown in following procedure:
The pseudo- static Web page generation method that the present embodiment is provided, by receiving web-page requests message, from net
Acquisition approach information in page request message;Resolution path information, obtains program logo, contribution mark;
Wherein, the corresponding original text of at least one contribution mark is included in the column corresponding to each program logo
Part;Identified according to program logo and contribution, judge that whether corresponding the response of web-page requests message is pseudo- static
Webpage;If so, obtaining column template corresponding with program logo in background data base;According to contribution
Mark, is extracted and the corresponding contribution of contribution mark in background data base;Will be corresponding with contribution mark
Contribution is filled in column template corresponding with program logo, is formed pseudo- static Web page and is presented to user.
So as to by storing column template, contribution data in background server, according to user's request URL
Parsing, contribution is matched with corresponding column template on backstage at any time, and foreground website clothes
Business device forms the pseudo- static Web page shown to user, and the True Data content for realizing pseudo- static Web page is deposited
Storage in background data base, consequently facilitating Dynamic Maintenance to data and to data content in time more
Newly;Meanwhile, webpage is shown in pseudo- static Web page form on foreground, makes pseudo- static Web page that there is pure static state
Webpage is easy to searched engine retrieval, the advantage included.
Fig. 2 is the flow chart of the embodiment two of the pseudo- static Web page generation method of the present invention, as shown in Fig. 2
On the basis of above-described embodiment one, the method for the present embodiment includes:
Step 201, reception web-page requests message, the acquisition approach information from web-page requests message.
Step 202, resolution path information, obtain program logo, contribution mark.
Step 203, corresponding first column of program logo is found in background data base according to program logo
Attribute information;Identified according to contribution and corresponding first contribution of contribution mark is found in background data base
Attribute information.
Specifically, for the management of column, can generally enter to column in the page of edlin, specify
The list page template of current column, and contribution belonging under the column a thin page template of looking at.Need to refer to simultaneously
Whether static state is enabled before settled, if enabled, corresponding pure static file can be generated;If not enabled,
Then access is provided according to pseudo-static mode.Accordingly, for the management of contribution content, backstage provides original text
The inputting interface of part content, all contributions are all to be entered into advance in the database on backstage.When contribution hair
During cloth, backstage is according to configuration, the mark in such as attribute information, it is determined whether the pure static file of generation is still
Pseudo- static file, if generating pure static file, static file is uniformly placed on glue file folder, then passes
It is delivered on the host server where the website of foreground;If the pseudo- static file of generation, is only needed to according to contribution
Mark finds correspondence contribution, to be filled into the column template corresponding to the contribution, then is published to website clothes
Being engaged in just can be with device.
If the attribute information of step 204, the attribute information of the first column and the first contribution both corresponds to non-outer
Portion is linked, it is determined that the response of web-page requests message corresponds to pseudo- static Web page.Continue executing with step 206.
If the attribute information of step 205, the attribute information of the first column and/or the first contribution corresponds to outside
Chained address, then according to external linkage address, the corresponding web page contents in external linkage address are presented to user.
Specifically, the priority of external linkage address is higher than the priority of non-external linkage, either column
In include start external linkage attribute information, or include in contribution start external linkage attribute
Information, the webpage for all directly asking user is externally oriented at the URL that link is indicated.Therefore, for
Column puppet static address generation logic is usually to first determine whether whether current column specifies external linkage, if
External linkage is specified, then its highest priority.If not specified external linkage, according to column destination path
Attribute is spliced into pseudo- static address, obtains the column path of pseudo- static Web page;Wherein, path attribute is usual
Including:Site information belonging to current column, such as website domain name, port (being defaulted as 80 ports), portion
Affix one's name to path etc..Similarly, the pseudo- static address generation logic of contribution is also to first determine whether whether current contribution specifies
External linkage, if specifying external linkage, its highest priority.If not specified external linkage,
Column path+current contribution mark (id number) according to belonging to contribution above-mentioned is spliced into pseudo- quiet
State address.Wherein, in the pseudo- static address resolution logic of foreground column, Front End Server may rely on
Spring mvc frameworks, are parsed to the URL of request according to unalterable rules.If URL belongs to static
The static URL request of webpage, directly carries out foreground according to the static web contents stored in Website server
It has been shown that, the static URL request of different puppets can generally be resolved to website homepage, column homepage, contribution
Thin page etc. of looking at is classified, and the Template Information then configured according to different objects finds corresponding template as complete
Pseudo- static Web page show.
If the pseudo- static Web page of response correspondence of step 206, web-page requests message, is obtained in background data base
Take column template corresponding with program logo.
Step 207, identified according to contribution, extracted and the corresponding contribution of contribution mark in background data base.
Step 208, column template corresponding with program logo will be filled in the corresponding contribution of contribution mark
In, form pseudo- static Web page and presented to user.
Fig. 3 is the structural representation of the embodiment one of the pseudo- static Web page generating means of the present invention, such as Fig. 3 institutes
Show, the device of the present embodiment includes:Receiving module 31, please from webpage for receiving web-page requests message
Seek acquisition approach information in message;Parsing module 32, for resolution path information, obtain program logo,
Contribution is identified;Wherein, at least one contribution mark institute is included in the column corresponding to each program logo
Corresponding contribution;Judge module 33, for according to program logo and contribution mark, judging that web-page requests disappear
The whether corresponding pseudo- static Web page of the response of breath;Acquisition module 34, for judging that webpage please according to judge module
When seeking the response correspondence puppet static Web page of message, column corresponding with program logo is obtained in background data base
Mesh template;Extraction module 35, for being identified according to contribution, extracts in background data base and is identified with contribution
Corresponding contribution;Module 36 is formed, for that will be filled in and program logo with the corresponding contribution of contribution mark
In corresponding column template, form pseudo- static Web page and presented to user.
The device of the present embodiment, can be used for the technical scheme for performing embodiment of the method one shown in Fig. 1,
Its implementing principle and technical effect is similar, and here is omitted.
The pseudo- static Web page generating means that the present embodiment is provided, by receiving web-page requests message, from net
Acquisition approach information in page request message;Resolution path information, obtains program logo, contribution mark;
Wherein, the corresponding original text of at least one contribution mark is included in the column corresponding to each program logo
Part;Identified according to program logo and contribution, judge that whether corresponding the response of web-page requests message is pseudo- static
Webpage;If so, obtaining column template corresponding with program logo in background data base;According to contribution
Mark, is extracted and the corresponding contribution of contribution mark in background data base;Will be corresponding with contribution mark
Contribution is filled in column template corresponding with program logo, is formed pseudo- static Web page and is presented to user.
So as to by storing column template, contribution data in background server, according to user's request URL
Parsing, contribution is matched with corresponding column template on backstage at any time, and foreground website clothes
Business device forms the pseudo- static Web page shown to user, and the True Data content for realizing pseudo- static Web page is deposited
Storage in background data base, consequently facilitating Dynamic Maintenance to data and to data content in time more
Newly;Meanwhile, webpage is shown in pseudo- static Web page form on foreground, makes pseudo- static Web page that there is pure static state
Webpage is easy to searched engine retrieval, the advantage included.
Fig. 4 is the structural representation of the embodiment two of the pseudo- static Web page generating means of the present invention, such as Fig. 4
It is shown, on the basis of Fig. 3 shown devices, further, judge module 33, specifically for root
The attribute information of corresponding first column of program logo is found in background data base according to program logo;Root
Identified according to contribution and the attribute information that contribution identifies corresponding first contribution is found in background data base;If
The attribute information of the attribute information of first column and the first contribution both corresponds to non-external linkage, it is determined that
The response of web-page requests message corresponds to pseudo- static Web page.
Optionally, device also includes:Calling module 37, for the attribute information when the first column and/or the
The attribute information of one contribution corresponds to external linkage address, then according to external linkage address, is presented to user
The corresponding web page contents in external linkage address.
Optionally, device also includes:The priority of external linkage address is higher than the priority of non-external linkage.
Optionally, module 36 is formed, specifically for using FreeMarker template engines, in background service
In device, contribution is identified into corresponding contribution and is filled in column template corresponding with program logo, generation is pseudo-
The input text of static Web page, so that user browser receives the input text institute of the pseudo- static Web page
Corresponding pseudo- static Web page.
The device of the present embodiment, can be used for the technical scheme for performing embodiment of the method two shown in Fig. 2, its
Implementing principle and technical effect are similar, and here is omitted.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than to it
Limitation;Although the present invention is described in detail with reference to the foregoing embodiments, the ordinary skill of this area
Personnel should be understood:It can still modify to the technical scheme described in previous embodiment, or
Equivalent substitution is carried out to which part technical characteristic;And these modifications or replacement, do not make relevant art
The essence of scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.