~ubuntu-branches/ubuntu/gutsy/libapache2-mod-python/gutsy

« back to all changes in this revision

Viewing changes to doc-html/pyapi-handler.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-07-07 13:18:35 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060707131835-zfp1vupanjj2e77y
Tags: 3.2.8-1ubuntu1
* Merge to Debian unstable.
* Remaining Ubuntu change: debian/{control,rules}: Drop python 2.3 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<link rel="STYLESHEET" href="modpython.css" type='text/css' />
5
 
<link rel="first" href="modpython.html" title='Mod_python Manual' />
6
 
<link rel='contents' href='contents.html' title="Contents" />
7
 
<link rel='index' href='genindex.html' title='Index' />
8
 
<link rel='last' href='about.html' title='About this document...' />
9
 
<link rel='help' href='about.html' title='About this document...' />
10
 
<link rel="next" href="pyapi-filter.html" />
11
 
<link rel="prev" href="pyapi-interps.html" />
12
 
<link rel="parent" href="pythonapi.html" />
13
 
<link rel="next" href="pyapi-filter.html" />
14
 
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
15
 
<meta name='aesop' content='information' />
 
4
<link rel="STYLESHEET" href="modpython.css" type='text/css'>
 
5
<link rel="first" href="modpython.html" title='Mod_python Manual'>
 
6
<link rel='contents' href='contents.html' title="Contents">
 
7
<link rel='index' href='genindex.html' title='Index'>
 
8
<link rel='last' href='about.html' title='About this document...'>
 
9
<link rel='help' href='about.html' title='About this document...'>
 
10
<LINK REL="next" href="pyapi-filter.html">
 
11
<LINK REL="prev" href="pyapi-interps.html">
 
12
<LINK REL="parent" href="pythonapi.html">
 
13
<LINK REL="next" href="pyapi-filter.html">
 
14
<meta name='aesop' content='information'>
 
15
<META NAME="description" CONTENT="Overview of a Request Handler">
 
16
<META NAME="keywords" CONTENT="modpython">
 
17
<META NAME="resource-type" CONTENT="document">
 
18
<META NAME="distribution" CONTENT="global">
16
19
<title>4.2 Overview of a Request Handler</title>
17
20
</head>
18
21
<body>
19
22
<DIV CLASS="navigation">
20
 
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
21
23
<table align="center" width="100%" cellpadding="0" cellspacing="2">
22
24
<tr>
23
 
<td class='online-navigation'><a rel="prev" title="4.1 Multiple Interpreters"
24
 
  href="pyapi-interps.html"><img src='previous.png'
25
 
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
26
 
<td class='online-navigation'><a rel="parent" title="4. Python API"
27
 
  href="pythonapi.html"><img src='up.png'
28
 
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
29
 
<td class='online-navigation'><a rel="next" title="4.3 Overview of a"
30
 
  href="pyapi-filter.html"><img src='next.png'
31
 
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
 
25
<td><a rel="prev" title="4.1 Multiple Interpreters" 
 
26
  href="pyapi-interps.html"><img src='previous.gif'
 
27
  border='0' height='32'  alt='Previous Page' width='32'></A></td>
 
28
<td><a rel="parent" title="4. Python API" 
 
29
  href="pythonapi.html"><img src='up.gif'
 
30
  border='0' height='32'  alt='Up One Level' width='32'></A></td>
 
31
<td><a rel="next" title="4.3 Overview of a" 
 
32
  href="pyapi-filter.html"><img src='next.gif'
 
33
  border='0' height='32'  alt='Next Page' width='32'></A></td>
32
34
<td align="center" width="100%">Mod_python Manual</td>
33
 
<td class='online-navigation'><a rel="contents" title="Table of Contents"
34
 
  href="contents.html"><img src='contents.png'
35
 
  border='0' height='32'  alt='Contents' width='32' /></A></td>
36
 
<td class='online-navigation'><img src='blank.png'
37
 
  border='0' height='32'  alt='' width='32' /></td>
38
 
<td class='online-navigation'><a rel="index" title="Index"
39
 
  href="genindex.html"><img src='index.png'
40
 
  border='0' height='32'  alt='Index' width='32' /></A></td>
 
35
<td><a rel="contents" title="Table of Contents" 
 
36
  href="contents.html"><img src='contents.gif'
 
37
  border='0' height='32'  alt='Contents' width='32'></A></td>
 
38
<td><img src='blank.gif'
 
39
  border='0' height='32'  alt='' width='32'></td>
 
40
<td><a rel="index" title="Index" 
 
41
  href="genindex.html"><img src='index.gif'
 
42
  border='0' height='32'  alt='Index' width='32'></A></td>
41
43
</tr></table>
42
 
<div class='online-navigation'>
43
44
<b class="navlabel">Previous:</b>
44
45
<a class="sectref" rel="prev" href="pyapi-interps.html">4.1 Multiple Interpreters</A>
45
46
<b class="navlabel">Up:</b>
46
47
<a class="sectref" rel="parent" href="pythonapi.html">4. Python API</A>
47
48
<b class="navlabel">Next:</b>
48
49
<a class="sectref" rel="next" href="pyapi-filter.html">4.3 Overview of a</A>
49
 
</div>
50
 
<hr /></div>
 
50
<br><hr>
51
51
</DIV>
52
52
<!--End of Navigation Panel-->
53
53
 
54
 
<H1><A NAME="SECTION006200000000000000000"></A><A NAME="pyapi-handler"></A>
 
54
<H1><A NAME="SECTION006200000000000000000">&nbsp;</A>
55
55
<BR>
56
56
4.2 Overview of a Request Handler
57
57
</H1>
58
 
<a id='l2h-15' xml:id='l2h-15'></a>
 
58
<a name="l2h-20">&nbsp;</a>
59
59
<P>
60
60
A <i class="dfn">handler</i> is a function that processes a particular phase of a
61
61
request. Apache processes requests in phases - read the request,
66
66
different from a handler written in C, and follows these rules:
67
67
 
68
68
<P>
69
 
<a id='l2h-17' xml:id='l2h-17'></a> <a id='l2h-16' xml:id='l2h-16'></a> A handler function will always
 
69
<a name="l2h-22">&nbsp;</a> <a name="l2h-21">&nbsp;</a> A handler function will always
70
70
be passed a reference to a request object. (Throughout this manual,
71
71
the request object is often referred to by the <code>req</code> variable.)
72
72
 
87
87
 
88
88
<P>
89
89
</LI>
90
 
<LI><tt class="constant">apache.<em>HTTP_ERROR</em></tt>, meaning an HTTP error occurred. 
 
90
<LI><tt class="constant">apache.<i>HTTP_ERROR</i></tt>, meaning an HTTP error occurred. 
91
91
  <var>HTTP_ERROR</var> can be any of the following:
92
92
 
93
93
<P>
147
147
</UL>
148
148
 
149
149
<P>
150
 
As an alternative to <em>returning</em> an HTTP error code, handlers can
151
 
signal an error by <em>raising</em> the <tt class="constant">apache.SERVER_RETURN</tt>
 
150
As an alternative to <i>returning</i> an HTTP error code, handlers can
 
151
signal an error by <i>raising</i> the <tt class="constant">apache.SERVER_RETURN</tt>
152
152
exception, and providing an HTTP error code as the exception value,
153
153
e.g.
154
154
 
189
189
<P>
190
190
 
191
191
<DIV CLASS="navigation">
192
 
<div class='online-navigation'>
193
 
<p></p><hr />
 
192
<p><hr>
194
193
<table align="center" width="100%" cellpadding="0" cellspacing="2">
195
194
<tr>
196
 
<td class='online-navigation'><a rel="prev" title="4.1 Multiple Interpreters"
197
 
  href="pyapi-interps.html"><img src='previous.png'
198
 
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
199
 
<td class='online-navigation'><a rel="parent" title="4. Python API"
200
 
  href="pythonapi.html"><img src='up.png'
201
 
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
202
 
<td class='online-navigation'><a rel="next" title="4.3 Overview of a"
203
 
  href="pyapi-filter.html"><img src='next.png'
204
 
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
 
195
<td><a rel="prev" title="4.1 Multiple Interpreters" 
 
196
  rel="prev" title="4.1 Multiple Interpreters" 
 
197
  href="pyapi-interps.html"><img src='previous.gif'
 
198
  border='0' height='32'  alt='Previous Page' width='32'></A></td>
 
199
<td><a rel="parent" title="4. Python API" 
 
200
  rel="parent" title="4. Python API" 
 
201
  href="pythonapi.html"><img src='up.gif'
 
202
  border='0' height='32'  alt='Up One Level' width='32'></A></td>
 
203
<td><a rel="next" title="4.3 Overview of a" 
 
204
  rel="next" title="4.3 Overview of a" 
 
205
  href="pyapi-filter.html"><img src='next.gif'
 
206
  border='0' height='32'  alt='Next Page' width='32'></A></td>
205
207
<td align="center" width="100%">Mod_python Manual</td>
206
 
<td class='online-navigation'><a rel="contents" title="Table of Contents"
207
 
  href="contents.html"><img src='contents.png'
208
 
  border='0' height='32'  alt='Contents' width='32' /></A></td>
209
 
<td class='online-navigation'><img src='blank.png'
210
 
  border='0' height='32'  alt='' width='32' /></td>
211
 
<td class='online-navigation'><a rel="index" title="Index"
212
 
  href="genindex.html"><img src='index.png'
213
 
  border='0' height='32'  alt='Index' width='32' /></A></td>
 
208
<td><a rel="contents" title="Table of Contents" 
 
209
  rel="contents" title="Table of Contents" 
 
210
  href="contents.html"><img src='contents.gif'
 
211
  border='0' height='32'  alt='Contents' width='32'></A></td>
 
212
<td><img src='blank.gif'
 
213
  border='0' height='32'  alt='' width='32'></td>
 
214
<td><a rel="index" title="Index" 
 
215
  rel="index" title="Index" 
 
216
  href="genindex.html"><img src='index.gif'
 
217
  border='0' height='32'  alt='Index' width='32'></A></td>
214
218
</tr></table>
215
 
<div class='online-navigation'>
216
219
<b class="navlabel">Previous:</b>
217
220
<a class="sectref" rel="prev" href="pyapi-interps.html">4.1 Multiple Interpreters</A>
218
221
<b class="navlabel">Up:</b>
219
222
<a class="sectref" rel="parent" href="pythonapi.html">4. Python API</A>
220
223
<b class="navlabel">Next:</b>
221
224
<a class="sectref" rel="next" href="pyapi-filter.html">4.3 Overview of a</A>
222
 
</div>
223
 
</div>
224
 
<hr />
225
 
<span class="release-info">Release 3.1.3, documentation updated on January 29, 2005.</span>
 
225
<hr>
 
226
<span class="release-info">Release 3.2.8, documentation updated on February 19, 2006.</span>
226
227
</DIV>
227
228
<!--End of Navigation Panel-->
228
229