⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 handlers.htm

📁 goahead是linux下的轻量级web服务器
💻 HTM
字号:
<html>
<head>
<title>URL Handlers -- GoAhead WebServer&#153;</title>
<link rel="stylesheet" href="../../style/normal.htm" type="text/css">
</head>

<body>
<h1>  URL Handlers</h1>
<P> The GoAhead WebServer implements a flexible URL handler 
where the semantics of a URL may be interpreted at run-time by multiple 
URL handlers. URL handlers are given the URL and the option of accepting 
it for processing. If a handler accepts the URL, no further 
URL handlers will be called.</P>
<P>A URL handler specifies a path prefix, a processing function and a order option. The 
path prefix nominates the URLs of interest. Any URL that matches this URL prefix is 
given to the handler for processing. A match is deemed to occur if 
the URL exactly matches the prefix for the length of the prefix. If 
more than one handler matches, the longest matching URL handler will be called 
first and so-on in decreasing length order. For example, the following 
all match the prefix &quot;/my&quot;:</P>
<P><pre>
/myCar?model= ford
/myPath/model/ford
/my/car/model/ford
</pre>
<P></P>
<p>A URL handler may supply the empty URL prefix 
&quot;&quot; and thus match all URLs. The order option enables a URL handler to 
specify that it wishes to be processed first or last regardless of the URL 
match. This is specified by the <i>flags</i>parameter to the 
<A href="websUrlHandlerDefine.htm">websUrlHandlerDefine</A> API call.&nbsp; If multiple 
handlers may specify these flags, the order of evaluation for the handlers 
specifiying the same flag is undefined.</p>
<p>A URL handler is a C procedure according to the 
following prototype:</p>
<pre>
int myHandler(webs_t wp, char_t *url, char_t *path, char_t *query);
</pre>
<P></P>
<P>The <i>url</i> parameter contains the entire URL. The <i>path</i> parameter 
holds the URL portion after the hostname and port number. The <i>query</i> 
parameter holds any optional query. The URL handler must return 1 if it elects 
to process the URL. Otherwise it should return 0 to indicate that a later URL 
handler should process the URL.</P>
<p>A URL handler may modify the settings of a request but 
delay handling of the URL to another handler. The security handler is one 
example of this. Request settings, form variables and URL details may be 
modified by a handler to affect the processing by other handlers.</p>  
<h2> See Also</h2>
<p>
<A href="asp.htm">Active Server Pages</A>, 
<A href="ejscript.htm">JavaScript</A>&#153;, 
<A href="goforms.htm">GoForms</A>&#153;,         
<A href="websSecurityHandler.htm">websSecurityHandler</A>, 
<A href="websUrlHandlerDefine.htm">websUrlHandlerDefine</A>         
</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -