Apache-ASP
view release on metacpan or search on metacpan
site/events.html view on Meta::CPAN
</tr>
<tr>
<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr> </nobr></b></font></td>
<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="todo.html" style="text-decoration:none"><font color=#063678>TODO</font></a></nobr></b></font></td>
</tr>
<tr>
<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr> </nobr></b></font></td>
<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="changes.html" style="text-decoration:none"><font color=#063678>CHANGES</font></a></nobr></b></font></td>
</tr>
<tr>
<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr> </nobr></b></font></td>
<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="license.html" style="text-decoration:none"><font color=#063678>LICENSE</font></a></nobr></b></font></td>
</tr>
<tr><td colspan=2><hr size=1></td></tr>
<tr>
<td bgcolor=white><font size=-2 face="verdana" color=#993399><b><nobr> </nobr></b></font></td>
<td bgcolor=white ><font face="verdana,helvetica" size=-1><b><nobr><a href="eg/index.html" style="text-decoration:none"><font color=#063678>EXAMPLES</font></a></nobr></b></font></td>
</tr>
</table>
</td></tr>
</table>
<br>
<center>
<a href=http://www.apache-asp.org/><img src="powered_by_apache_asp.jpg" width="88" height="31" alt="Powered by Apache::ASP" border="0"></a>
<br>
<a href=http://perl.apache.org><img src="powered_by_modperl.gif" width="88" height="31" alt="Powered by ModPerl and Apache" border="0"></a>
<br>
<a href=http://www.perl.com><img src="rectangle_power_perl.gif" width="88" height="31" alt="Powered by Perl" border="0"></a>
</center>
</td>
<td valign=top bgcolor=white>
<font size=+0 face=verdana,arial>
<font face=verdana><font class=title size=+1 color=#555555><b>EVENTS</b></font>
</font>
<hr size=1>
<table width=100% border=0 cellpadding=1 cellspacing=3>
<tr>
<td valign=top><font face="lucida console" size=-1>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Overview>Overview</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Script_OnPar383e5cdf>Script_OnParse</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Script_OnSta6a4cfa7f>Script_OnStart & Script_OnEnd</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Application_61345d1d>Application_OnStart</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Session_OnSt3cfacd72>Session_OnStart</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Application_4bca009c>Application_OnEnd</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Session_OnEne9575396>Session_OnEnd</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Server_OnSta0d174f59>Server_OnStart ( pseudo-event )</a>
</font>
</td>
</tr>
<tr>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#Script_OnFludc73a8d8>Script_OnFlush</a>
</font>
</td>
<td valign=top >
<font face="lucida console" size=-1>
<a href=#mod_perl%20han02da5c9c>mod_perl handlers</a>
</font>
</td>
</tr>
</table>
<hr size=1>
<p>
<p>
<a name=Overview></a>
<font face=verdana><font class=title size=+0 color=#555555><b>Overview</b></font>
<font face="courier new" size=3><pre>
</pre></font>The ASP platform allows developers to create Web Applications.
In fulfillment of real software requirements, ASP allows
event-triggered actions to be taken, which are defined in
a global.asa file. The global.asa file resides in the
Global directory, defined as a config option, and may
define the following actions:
<font face="courier new" size=3><pre>
Action Event
------ ------
Script_OnStart * Beginning of Script execution
Script_OnEnd * End of Script execution
Script_OnFlush * Before $Response being flushed to client.
Script_OnParse * Before script compilation
Application_OnStart Beginning of Application
Application_OnEnd End of Application
Session_OnStart Beginning of user Session.
Session_OnEnd End of user Session.
* These are API extensions that are not portable, but were
added because they are incredibly useful
</pre></font>These actions must be defined in the $Global/global.asa file
as subroutines, for example:
<font face="courier new" size=3><pre>
sub Session_OnStart {
$Application->{$Session->SessionID()} = started;
}
</pre></font>Sessions are easy to understand. When visiting a page in a
web application, each user has one unique $Session. This
session expires, after which the user will have a new
$Session upon revisiting.
<font face="courier new" size=3><pre>
</pre></font>A web application starts when the user visits a page in that
application, and has a new $Session created. Right before
the first $Session is created, the $Application is created.
When the last user $Session expires, that $Application
expires also. For some web applications that are always busy,
the Application_OnEnd event may never occur.</font>
<p>
<a name=Script_OnSta6a4cfa7f></a>
<font face=verdana><font class=title size=+0 color=#555555><b>Script_OnStart & Script_OnEnd</b></font>
<font face="courier new" size=3><pre>
</pre></font>The script events are used to run any code for all scripts
in an application defined by a global.asa. Often, you would
like to run the same code for every script, which you would
otherwise have to add by hand, or add with a file include,
( run in 2.348 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )