Processing A Request In Coldfusion - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

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
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
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
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.
function to output the value 100,000 in
LSCurrencyFormat
Server.Coldfusion.SupportedLocales
Content-Language

Processing a request in ColdFusion

, which
377

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents