
285
DEVELOPING
COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Las
t
upda
te
d 8/5/2010
In general, production Exception and Request pages should not display detailed error information, such as that
supplied by the
error.diagnostics
variable. Typically, Exception pages e-mail detailed error information to an
administrative address or log the information using the
cflog
tag instead of displaying it to the user. For more
information on using the
cflog
tag, see “
Logging errors with the cflog tag
” on page 285.
Example of a request error page
The following example shows a custom error page for a request error:
<html>
<head>
<title>Products - Error</title>
</head>
<body>
<h2>Sorry</h2>
<p>An error occurred when you requested this page.</p>
<p>Please send e-mail with the following information to #error.mailTo# to report
this error.</p>
<table border=1>
<tr><td><b>Error Information</b> <br>
Date and time: #error.DateTime# <br>
Page: #error.template# <br>
Remote Address: #error.remoteAddress# <br>
HTTP Referer: #error.HTTPReferer#<br>
</td></tr></table>
<p>We apologize for the inconvenience and will work to correct the problem.</p>
</body>
</html>
Example of a validation error page
The following example shows a simple custom error page for a validation error:
<html>
<head>
<title>Products - Error</title>
</head>
<body>
<h2>Data Entry Error</h2>
<p>You failed to correctly complete all the fields
in the form. The following problems occurred:</p>
#error.invalidFields#
</body>
</html>
Logging errors with the cflog tag
ColdFusion provides extensive capabilities for generating, managing, and viewing log files, as described in
Configuring
and Administering ColdFusion
. It also provides the
cflog
tag which adds entries to ColdFusion logs.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...