Adobe COLDFUSION 9 Manual page 260

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
</cfif>
</cflock>
</cfif>
<!--- Set a Session variable.--->
<cflock timeout="20" scope="Session" type="exclusive">
<cfif not IsDefined("session.pagesHit")>
<cfset session.pagesHit=1>
<cfelse>
<cfset session.pagesHit=session.pagesHit+1>
</cfif>
</cflock>
<!--- Set Application-specific Variables scope variables. --->
<cfset mainpage = "default.cfm">
<cfset current_page = "#cgi.path_info#?#cgi.query_string#">
<!--- Include a file containing user-defined functions called throughout
the application. --->
<cfinclude template="commonfiles/productudfs.cfm">
Reviewing the code
The following table describes the code and its function:
Code
<cfapplication name="Products"
clientmanagement="Yes"
clientstorage="myCompany"
sessionmanagement="Yes">
<cfsetting showDebugOutput="No">
<cferror type="request"
template="requesterr.cfm"
mailto="admin@company.com">
<cferror type="validation"
template="validationerr.cfm">
<cfset app_is_initialized = False>
<cflock timeout="20" scope="Session"
type="exclusive">
<cfif not IsDefined("session.pagesHit")>
<cfset session.pagesHit=1>
<cfelse>
<cfset session.pagesHit=session.pagesHit+1>
</cfif>
</cflock>
<cfset mainpage = "default.cfm">
<cfset current_page =
"#cgi.path_info#?#cgi.query_string#">
<cfinclude template="commonfiles/productudfs.cfm">
Description
Names the application, enables Client and Session scope variables,
and sets the client variable store to the myCompany data source.
Ensures that debugging output is not displayed, if the ColdFusion
Administrator enables it.
Specifies custom error handlers for request and validation errors
encountered in the application. Specifies the mailing address for use in
the request error handler.
Sets the Application scope variables, if they are not already set. For a
detailed description of the technique used to set the Application
scope variables, see
Sets the Session scope
of pages touched in this session. If the variable does not exist, creates
it; otherwise, increments it.
Sets two Variables scope variables that are used throughout the
application. Creates the current_page variable dynamically; its value
varies from request to request.
Includes a library of user-defined functions that are used in most pages
in the application.
Last updated 8/5/2010
"Using Persistent Data and
Locking" on page 301.
pagesHit
variable, which counts the number
255

Advertisement

Table of Contents
loading

Table of Contents