CN103067511B - A kind of control method of HTTP request process - Google Patents
A kind of control method of HTTP request process Download PDFInfo
- Publication number
- CN103067511B CN103067511B CN201210587851.1A CN201210587851A CN103067511B CN 103067511 B CN103067511 B CN 103067511B CN 201210587851 A CN201210587851 A CN 201210587851A CN 103067511 B CN103067511 B CN 103067511B
- Authority
- CN
- China
- Prior art keywords
- request
- class
- application server
- rpc
- web application
- 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.)
- Active
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of control method of HTTP request process, concrete control method comprises the steps: step S1, the message of WEB application server intercepts RPC request when producing RPC request in GWT foreground, and extracts the title realizing class and the request content extracting RPC request in message in the request path of annotation in message; Step S2, WEB application server load the corresponding example realizing class according to the title realizing class in WEB configuration file; Step S3, WEB application server call the example realizing class according to request content; Step S4, WEB application server return the http response on GWT foreground according to the result that the example realizing class returns.The beneficial effect of technique scheme is: reduce the configuration entry of configuration file, reduce coupling, the Optimizing Flow of module, provide sole inlet, facilitate the control of affairs; Memory consumption reduces, and session status can retain.<!--1-->
Description
Technical field
The present invention relates to a kind of control method of WEB server, particularly relate to a kind of HTTP(HypertextTransferProtocol HTML (Hypertext Markup Language)) request process control method.
Background technology
WEB application generally comprises the HTTP interface on foreground and the WEB application server on backstage, GWT(GoogleWebToolkit Google WEB kit) be a kind of asynchronous JavaScript and XML of AJAX(AsynchronousJavaScriptandXML that Java programming language can be used to write) front end cross compile is to the JavaScript(Java small routine optimized) and in thus the developing instrument of reduction foreground development difficulty, be therefore subject to extensive use.But, when using table frame before GWT, RPC(RemoteProcedureCallProtocol remote procedure call protocol according to the number of business relates to) call various, the service routine entry RPC that is too much, correspondence simultaneously configured in configuration file is caused to realize class too much, and must inherit specify parent cause invasive between module very strong, flexibility ratio is not enough, and close coupling makes code maintenance and Function Extension complexity.
Summary of the invention
For the problems referred to above that the WEB system of table frame before existing use GWT exists, now provide a kind of control method being intended to overcome the HTTP request process of code close coupling.
Concrete technical scheme is as follows:
A control method for HTTP request process, is applied to and uses the WEB system on GWT foreground, and wherein, definition one realizes class for what realize RPC request; Add in RPC interface annotation in described GWT foreground and complete comprise the described request path realizing the title of class, and realize class with the name registration identical with described request path in WEB configuration file by described; Concrete control method when described RPC request produces comprises the steps:
The message of step S1, RPC request described in WEB application server intercepts when described GWT foreground produces RPC request, and extract in the described request path of annotation in described message described realize class title and in described message, extract the request content that described RPC asks;
Step S2, described WEB application server load the corresponding example realizing class according to the described title realizing class in described WEB configuration file;
Step S3, described WEB application server call the described example realizing class according to described request content;
Step S4, described WEB application server return the http response on described GWT foreground according to the result that the described example realizing class returns.
Preferably, judge whether described message is text/x-gwt-rpc type, if not being that text/x-gwt-rpc type then stops processing and returning exception during the message of RPC request described in described WEB application server intercepts.
Preferably, described request content comprises instantiation parameter and calls the described interface method title realizing class.
Preferably, described WEB application server is by realizing realizing calling of the example of class to described to the described example realizing class by described instantiation parameter and interface method name delivery.
Preferably, WEB application server imports described instantiation parameter into the described example realizing class by the method for reflex activation.
The beneficial effect of technique scheme is:
1, reduce configuration file configuration entry, reduce module coupling, Optimizing Flow, sole inlet is provided, facilitate the control of affairs.
2, memory consumption reduces, and session status can retain.
Accompanying drawing explanation
Figure is the steps flow chart block diagram of the embodiment of the control method of a kind of HTTP request process of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
As shown in Figure 1, the embodiment of the control method of a kind of HTTP request process of the present invention, is applied to and uses the WEB system on GWT foreground, and wherein, definition one realizes class for what realize RPC request; Add the request path that complete comprising realizes the title of class in RPC interface annotation in GWT foreground, and will class be realized with the name registration identical with request path in WEB configuration file; Concrete control method when RPC request produces comprises the steps:
The message of step S1, WEB application server intercepts RPC request when to produce RPC request in GWT foreground, and extract the title realizing class and the request content extracting RPC request in message in the request path of annotation in message;
Step S2, WEB application server load the corresponding example realizing class according to the title realizing class in WEB configuration file;
Step S3, WEB application server call the example realizing class according to request content;
Step S4, WEB application server return the http response on GWT foreground according to the result that the example realizing class returns.
One preferably execution mode is that technique scheme can adopt SPRING framework to implement, and it is to be noted that not limiting technical scheme of the present invention with this only can use SPRING framework to implement.
On technique scheme basis, further, judge whether message is text/x-gwt-rpc type during the message that WEB application server intercepts RPC asks, if not being that text/x-gwt-rpc type then stops processing and returning exception.
On technique scheme basis, further, request content comprises instantiation parameter and calls the interface method title realizing class.WEB application server can adopt the method for analytic message content obtain instantiation parameter and call the interface method title realizing class.
On technique scheme basis, further, WEB application server is by realizing calling the example realizing class by instantiation parameter and interface method name delivery to the example realizing class.
On technique scheme basis, instantiation parameter is imported into by the method for reflex activation the example realizing class by further WEB application server.Because reflex activation is the method that those skilled in the art commonly use, therefore repeat no more.
Technique scheme realizes the title of class and call method by analytic message content obtaining and transmits instantiation parameter in the mode of reflex activation thus do not need in WEB configuration file, configure various configuration entry, the code degree of coupling of WEB configuration file is reduced, thus expansion is convenient in the flexibility that improve system.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection range is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations specification of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.
Claims (4)
1. a control method for HTTP request process, is applied to and uses the WEB system on GWT foreground, it is characterized in that, definition one realizes class for what realize RPC request; Add in RPC interface annotation in described GWT foreground and complete comprise the described request path realizing the title of class, and realize class with the name registration identical with described request path in WEB configuration file by described; Concrete control method when described RPC request produces comprises the steps:
The message of step S1, RPC request described in WEB application server intercepts when described GWT foreground produces RPC request, and extract in the described request path of annotation in described message described realize class title and in described message, extract the request content that described RPC asks;
Step S2, described WEB application server load the corresponding example realizing class according to the described title realizing class in described WEB configuration file;
Step S3, described WEB application server call the described example realizing class according to described request content, and described request content comprises instantiation parameter and calls the described interface method title realizing class;
Step S4, described WEB application server return the http response on described GWT foreground according to the result that the described example realizing class returns.
2. the control method of HTTP request process as claimed in claim 1, it is characterized in that, judge whether described message is text/x-gwt-rpc type, if not being that text/x-gwt-rpc type then stops processing and returning exception during the message of RPC request described in described WEB application server intercepts.
3. the control method of HTTP request process as claimed in claim 1, is characterized in that, described WEB application server is by realizing realizing calling of the example of class to described to the described example realizing class by described instantiation parameter and interface method name delivery.
4. the control method of HTTP request process as claimed in claim 3, is characterized in that, WEB application server imports described instantiation parameter into the described example realizing class by the method for reflex activation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210587851.1A CN103067511B (en) | 2012-12-28 | 2012-12-28 | A kind of control method of HTTP request process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210587851.1A CN103067511B (en) | 2012-12-28 | 2012-12-28 | A kind of control method of HTTP request process |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103067511A CN103067511A (en) | 2013-04-24 |
CN103067511B true CN103067511B (en) | 2016-03-30 |
Family
ID=48109965
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210587851.1A Active CN103067511B (en) | 2012-12-28 | 2012-12-28 | A kind of control method of HTTP request process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103067511B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354481B (en) * | 2015-07-13 | 2019-12-27 | 阿里巴巴集团控股有限公司 | Method and equipment for uniformly mapping HTTP (hyper text transport protocol) request |
CN105955790B (en) * | 2016-05-20 | 2019-05-14 | 广州华多网络科技有限公司 | Data processing method and device |
CN108040126B (en) * | 2017-12-29 | 2021-07-16 | 贵阳语玩科技有限公司 | Method and device for initiating HTTP request |
CN109919749A (en) * | 2019-03-29 | 2019-06-21 | 北京思特奇信息技术股份有限公司 | A kind of account checking method, system, storage medium and computer equipment |
CN111352748B (en) * | 2020-02-26 | 2023-12-05 | 北京思特奇信息技术股份有限公司 | Interface calling method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2259551A1 (en) * | 2009-06-05 | 2010-12-08 | Software AG | Gateway server system comprising a gateway server for making SOAP/XML-based web services accessible to RPC clients |
CN102436373A (en) * | 2011-09-13 | 2012-05-02 | 上海普元信息技术股份有限公司 | Method for realizing resource loading and resource hot-updating in distributed enterprise application system |
-
2012
- 2012-12-28 CN CN201210587851.1A patent/CN103067511B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2259551A1 (en) * | 2009-06-05 | 2010-12-08 | Software AG | Gateway server system comprising a gateway server for making SOAP/XML-based web services accessible to RPC clients |
CN102436373A (en) * | 2011-09-13 | 2012-05-02 | 上海普元信息技术股份有限公司 | Method for realizing resource loading and resource hot-updating in distributed enterprise application system |
Also Published As
Publication number | Publication date |
---|---|
CN103067511A (en) | 2013-04-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103067511B (en) | A kind of control method of HTTP request process | |
CN104484216B (en) | Service interface document and on-line testing instrument generation method, device | |
CN104158836B (en) | A kind of method by data render mobile application interface | |
CN104866327B (en) | A kind of PHP development approaches and framework | |
CN103179133B (en) | Based on the client of entity class and the method for server communication | |
CA2511912A1 (en) | System and method for building and execution of platform-neutral generic services' client applications | |
CN106341444A (en) | Data access method and device | |
CN102520985A (en) | System and method for running client software | |
EP2869222A1 (en) | Methods for extending a selector application programming interface and devices thereof | |
CN101957756A (en) | System and method for rapidly generating intelligent mobile terminal program | |
CN102799764B (en) | A kind of engineering calculation system of sing on web and method | |
CN104410702A (en) | Remote service request method, response method, request device and response device | |
CN102546737B (en) | Wireless Internet gateway access system and method | |
CN102255961B (en) | Java 2 micro edition (J2ME)-based Web Service interface calling method | |
CN110045950A (en) | Static page based on nodejs develops scaffold method | |
CN106357781A (en) | Method and system for establishing resource service calling interface | |
CN103051728A (en) | Remote-procedure calling method | |
CN103561113B (en) | The generation method and device of Web Service interface | |
CN102999360A (en) | Realization method for dynamic clock based on embedded WEB-OMT (object modeling technology) page | |
CN102436391A (en) | Android WebKit control method and system | |
CN102651023B (en) | Method and device for controlling input data | |
CN101815064A (en) | Data interaction method and device thereof | |
CN103164226A (en) | Set top box human-computer interface automatic generating method | |
CN110134394A (en) | A kind of web interface generation method for supporting multiple terminals | |
CN103399746B (en) | Information management system convenient to develop secondarily and development method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |