Dispatcher类总共有将近2000行代码。。

Dispatcher继承自AbstractController,从之前的博客(https://www.cnblogs.com/2008nmj/p/14768732.html)可以知道,该类是负责处理请求的,转发给各个相关的类分别处理。
看该类的简介:
/**
* Dispatches an http request to an open web service (OWS).将一个http请求派发给OWS。
*
* <p>An OWS request contains three bits of information:一个OWS请求包含三点信息:
*
* <ol>
* <li>The service being called 调用的服务
* <li>The operation of the service to execute 服务要执行的的操作
* <li>The version of the service ( optional ) 服务的版本(可选)
* </ol>
*
* <p>Additional, an OWS request can contain an arbitray number of additional parameters.除此之外,一个OWS请求还可以包含任意数量的额外的参数。
*
* <p>An OWS request can be specified in two forms. The first form is known as "KVP" in which all一个OWS请求可以以两种形式来指定。第一种形式是“KVP”,其中所有的参数都是以键值对的形式组成的。通常,这种形式的请求是以http "GET"请求的方式生成的,参数
* the parameters come in the form of a set of key-value pairs. Commonly this type of request is 在请求字符串中指定:
* made in an http "GET" request, the parameters being specified in the query string:
*
* <pre>
* <code>http://www.xyz.com/geoserver?service=someService&request=someRequest&version=X.Y.Z&param1=...&param2=...</code>
* </pre>
*
* <p>This type of request can also be made in a "POST" request in with a mime-type of这种类型的请求也可以在mime类型为“application/x-www-form-urlencoded”的“POST”请求中进行。
* "application/x-www-form-urlencoded".
*
* <p>The second form is known as "XML" in which all the parameters come in the form of an xml 第二种形式称为“XML”,其中所有参数都以XML的形式出现文件。这种类型的请求是在http“POST”请求中发出的。
* document. This type of request is made in an http "POST" request.
*
* <pre><code>
* <?xml version="1.0" encoding="UTF-8"?>
* <SomeRequest service="someService" version="X.Y.Z">
* <Param1>...</Param1>
* <Param2>...</Param2>
* ...
* </SomeRequest>
* </code></pre>
*
* <p>When a request is received, the <b>service</b> the <b>version</b> parameters are used to当接收到请求时,
* locate a service desciptor, an instance of {@link Service} . With the service descriptor, the
* <b>request</b> parameter is used to locate the operation of the service to call.
*
* @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
*/


向开放的Web服务(OWS)发送http请求。
OWS请求包含三位信息:
1.被调用的服务
2.要执行的服务的操作
3.服务版本(可选)
另外,OWS请求可以包含附加参数的仲裁数。
OWS请求可以通过两种形式指定。第一种形式称为“kvp”,其中所有参数都以一组键值对的形式出现。通常这种类型的请求是 在http“get”请求中发出,在查询字符串中指定的参数:
http: //ww. xyz. com/ geoserver?service=someServi ce&request-someRequest&version=X. Y. Z&par am1-... bparam2=...
这种类型的请求也可以在“POST”请求中使用MIME类型的“application/x-www-form-urlencode”进行。
第二种形式称为“XML”,其中所有参数都以XML文档的形式出现。这类请求是在http“POST”请求中提出的。 50meinequest .ennce, 50不平等。 omeService” version= "X. Y. I"> MomeService“Version=”X.Y.i“> <Param2>... </Par am2> <Param 2>.</param 2> </ SomeRequest> </SomeRequest> When a request is received, the service the version parameters are used to locate a service desciptor, an instance of {@link Service} . With the service descriptor, the request parameter is 当接收到请求时,将使用版本参数的服务来定位服务指示符({@link Service}的实例)。对于服务描述符,请求参数为 used to locate the operation of the service to call. @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org 用于定位要调用的服务的操作。@作者Justin Deoliveira,“开放规划项目”,jdelive@openplans.org




浙公网安备 33010602011771号