User Guide

Table Of Contents
6 Contents
CHAPTER 14: Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
About error handling in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Understanding errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Error messages and the standard error format . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Determining error-handling strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Specifying custom error messages with the cferror tag . . . . . . . . . . . . . . . . . . . . . 317
Logging errors with the cflog tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Handling runtime exceptions with ColdFusion tags . . . . . . . . . . . . . . . . . . . . . . 322
CHAPTER 15: Using Persistent Data and Locking . . . . . . . . . . . . . . . . . . . . . . . 339
About persistent scope variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Managing the client state. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Configuring and using client variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Configuring and using session variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Configuring and using application variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Using server variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Locking code with cflock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Examples of cflock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
CHAPTER 16: Securing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
ColdFusion security features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
About resource and sandbox security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
About user security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Using ColdFusion security tags and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Security scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Implementing user security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
CHAPTER 17: Developing Globalized Applications . . . . . . . . . . . . . . . . . . . . . . 403
Introduction to globalization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
About character encodings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Locales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Processing a request in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Tags and functions for globalizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Handling data in ColdFusion MX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
CHAPTER 18: Debugging and Troubleshooting Applications . . . . . . . . . . . . . . 423
Configuring debugging in the ColdFusion MX Administrator . . . . . . . . . . . . . . 423
Using debugging information from browser pages. . . . . . . . . . . . . . . . . . . . . . . . 426
Controlling debugging information in CFML. . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Using the cftrace tag to trace execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Using the cftimer tag to time blocks of code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Using the Code Compatibility Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Troubleshooting common problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443