Processing a request in ColdFusion
377
The current locale has two effects:
•
When ColdFusion formats date, time, currency, or numeric output, it determines how to
format the output. You can change the locale multiple times on a ColdFusion page to format
information according to different locale conventions. This enables you to output a page that
properly formats different currency values, for example.
•
When ColdFusion returns a page to the client, it includes the HTTP
Content-Language
header. ColdFusion uses the last locale setting on the page for this information.
Note:
Prior to ColdFusion MX, the default locale was always English, not the operating system’s
locale. For the Japanese version of ColdFusion, the default was Japanese.
The following example uses the
LSCurrencyFormat
function to output the value 100,000 in
monetary units for all the ColdFusion-supported locales. You can run this code to see how the
locale affects the data returned to a browser.
<p>LSCurrencyFormat returns a currency value using the locale convention.
<!--- loop through list of locales; show currency values for 100,000 units --->
<cfloop LIST = "#Server.Coldfusion.SupportedLocales#"
index = "locale" delimiters = ",">
<cfset oldlocale = SetLocale(locale)>
<cfoutput><p><b><I>#locale#</I></b><br>
Local: #LSCurrencyFormat(100000, "local")#<br>
International: #LSCurrencyFormat(100000, "international")#<br>
None: #LSCurrencyFormat(100000, "none")#<br>
<hr noshade>
</cfoutput>
</cfloop>
This example uses the ColdFusion variable
Server.Coldfusion.SupportedLocales
, which
contains a list of all supported ColdFusion locales.
Processing a request in ColdFusion
When ColdFusion receives an HTTP request for a ColdFusion page, ColdFusion resolves the
request URL to a physical file path and reads the file contents to parse it. A ColdFusion page can
be encoded in any character encoding supported by the JVM used by ColdFusion, but might
need to be specified so that ColdFusion can identify it.
The following figure shows an example of a client making a request to ColdFusion:
The content of the ColdFusion page on the server can be static data (typically HTML and plain
text not processed by ColdFusion), and dynamic content written in CFML. Static content is
written directly to the response to the browser, and dynamic content is processed by ColdFusion.
Summary of Contents for ColdFusion MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......