MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 276

Developing coldfusion mx applications
Table of Contents

Advertisement

<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">
276
Chapter 13: Designing and Optimizing a ColdFusion Application
Description
Names the application, enables Client and Session
scope variables, and sets the client variable store to the
myCompany data source.
Ensure that debugging output is not displayed, if the
ColdFusion MX 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
15, "Using Persistent Data and Locking," on page
Sets the Session scope
the number 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; it's value varies from request to
request.
Includes a library of user-defined functions that are used
in most pages in the application.
variable, which counts
pagesHit
Chapter
315.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents