<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Whatley &#187; HTTP</title>
	<atom:link href="http://www.simonwhatley.co.uk/tag/http/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>An Introduction to the Semantic Web</title>
		<link>http://www.simonwhatley.co.uk/an-introduction-to-the-semantic-web</link>
		<comments>http://www.simonwhatley.co.uk/an-introduction-to-the-semantic-web#comments</comments>
		<pubDate>Fri, 18 Jun 2010 12:20:49 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[DCMI]]></category>
		<category><![CDATA[Dublin Core]]></category>
		<category><![CDATA[Dublin Core Metadata Initiative]]></category>
		<category><![CDATA[FOAF]]></category>
		<category><![CDATA[Friend of a Friend]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Linked Data]]></category>
		<category><![CDATA[machine readable]]></category>
		<category><![CDATA[Natural Language Processing]]></category>
		<category><![CDATA[ontology]]></category>
		<category><![CDATA[OpenCalais]]></category>
		<category><![CDATA[OWL]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[PURL]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[RDF query language]]></category>
		<category><![CDATA[RDFa]]></category>
		<category><![CDATA[RDFs]]></category>
		<category><![CDATA[Resource Description Framework]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[subject-predicate-object]]></category>
		<category><![CDATA[Thomson Reuters]]></category>
		<category><![CDATA[Tim Berners-Lee]]></category>
		<category><![CDATA[Triplestore]]></category>
		<category><![CDATA[Uniform Resource Identifier]]></category>
		<category><![CDATA[Uniform Resource Locator]]></category>
		<category><![CDATA[Uniform Resource Name]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[web of data]]></category>
		<category><![CDATA[Web Ontology Language]]></category>
		<category><![CDATA[world wide web]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=3559</guid>
		<description><![CDATA[The Semantic Web is a web of data. There is lots of data we all use every day, and most of it is not part of the web. I can see my bank statements on the web, and my photographs, and I can see my appointments in a calendar. But can I see my photos in a calendar to see what I was doing when I took them and on a map so I know where I took them? Can I see bank statement lines in a calendar? The answer, right now, is no.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/Semantic_Web" title="Wikipedia: Semantic Web" target="_blank" rel="nofollow">Semantic Web</a> is a <a href="http://en.wikipedia.org/wiki/Linked_Data" title="Wikipedia: Linked Data" target="_blank" rel="nofollow">web of data</a>. There is lots of data we all use every day, and most of it is not part of the web. I can see my bank statements on the web, and my photographs, and I can see my appointments in a calendar. But can I see my photos in a calendar to see what I was doing when I took them and on a map so I know where I took them? Can I see bank statement lines in a calendar? The answer, right now, is no.</p>
<p>But why not? Because we don&#8217;t have a web of data. Because data is controlled by applications, and each application keeps its data to itself; applications don&#8217;t like to share.</p>
<p>The original Web mainly concentrated on the interchange of documents, however, the Semantic Web is about two things: It is about common formats for integration and combination of data drawn from diverse sources. It is also about language for recording how the data relates to real world objects. That allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing.</p>
<p>Tim Berners-Lee describes the Semantic Web vision as:</p>
<blockquote><p>I have a dream for the Web [in which computers] become capable of analysing all the data on the Web, the content, links, and transactions between people and computers. A Semantic Web, which should make this possible, has yet to emerge, but when it does, the day-to-day mechanisms of trade, bureaucracy and our daily lives will be handled by machines talking to machines. The intelligent agents people have touted for ages will finally materialise.</p></blockquote>
<p>What are the ideas and technologies that facilitate this vision? Below I give an overview and links to a number of them:</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Linked Data</h3>
<p>Linked Data is about using the Web to connect related data that wasn&#8217;t previously linked, or using the Web to lower the barriers to linking data currently linked using other methods. More specifically, Wikipedia defines Linked Data as &#8220;a term used to describe a recommended best practice for exposing, sharing, and connecting pieces of data, information, and knowledge on the Semantic Web using <abbr title="Uniform Resource Identifier">URIs</abbr> and <abbr title="Resource Description Framework">RDF</abbr>.&#8221;</p>
<ul>
<li><a href="http://linkeddata.org" title="Linked Data: Connect Distributed Data Across The Web" target="_blank" rel="nofollow">http://linkeddata.org</a></li>
<li><a href="http://en.wikipedia.org/wiki/Linked_Data" title="Wikipedia: Linked Data" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Linked_Data</a></li>
</ul>
<h3>Resource Description Framework</h3>
<p>The Resource Description Framework (<abbr title="Resource Description Framework">RDF</abbr>) is a general-purpose language for representing information in the Web.</p>
<p>The <strong>Resource Description Framework Schema (<abbr title="Resource Description Framework Schema">RDF-S</abbr>)</strong> is a semantic extension of <abbr title="Resource Description Framework">RDF</abbr> that provides mechanisms for describing groups of related resources and the relationships between these resources.</p>
<ul>
<li><a href="http://www.w3.org/TR/rdf-schema/" title="World Wide Web Consortium: RDF Schema" target="_blank" rel="nofollow">http://www.w3.org/TR/rdf-schema/</a></li>
<li><a href="http://en.wikipedia.org/wiki/RDF_Schema" title="Wikipedia: RDF Schema" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/RDF_Schema</a></li>
</ul>
<p>The <strong>Resource Description Framework in Attributes (<abbr title="Resource Description Framework in Attributes">RDFa)</strong> allows authors to add meaning to web page elements. Using a few simple <abbr title="eXtensible HyperText Markup Language">XHTML</abbr> attributes, authors can mark up human-readable data with machine-readable indicators for browsers and other programs to interpret. A web page can include markup for items as simple as the title of an article, or as complex as a user&#8217;s complete social network.</p>
<ul>
<li><a href="http://www.w3.org/TR/xhtml-rdfa-primer/" title="World Wide Web Consortium: XHTML RDFa Primer" target="_blank" rel="nofollow">http://www.w3.org/TR/xhtml-rdfa-primer/</a></li>
<li><a href="http://en.wikipedia.org/wiki/RDFa" title="Wikipedia: RDFa" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/RDFa</a></li>
</ul>
<h3>Friend of a Friend (<abbr title="Friend of a Friend">FOAF</abbr>)</h3>
<p>The <em>Friend of a Friend</em> project is creating a Web of machine-readable pages describing people, the links between them and the things they create and do. <abbr title="Friend of a Friend">FOAF</abbr> is about your place in the Web, and the Web&#8217;s place in our world. <abbr title="Friend of a Friend">FOAF</abbr> is a simple technology that makes it easier to share and use information about people and their activities (eg. photos, calendars, weblogs), to transfer information between Web sites, and to automatically extend, merge and re-use it online.</p>
<ul>
<li><a href="http://www.foaf-project.org" title="FOAF Project" target="_blank" rel="nofollow">http://www.foaf-project.org</a></li>
<li><a href="http://en.wikipedia.org/wiki/FOAF_(software)" title="Wikipedia: FOAF (Software)" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/FOAF_(software)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Friend_of_a_friend" title="Wikipedia: Friend of a Friend" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Friend_of_a_friend</a></li>
<li><a href="http://xmlns.com/foaf/spec/" title="FOAF Vocabulary Specification" target="_blank" rel="nofollow">http://xmlns.com/foaf/spec/</a></li>
</ul>
<h3>Web Ontology Language (<abbr title="Web Ontology Language">OWL</abbr>)</h3>
<p>The <abbr title="Web Ontology Language">OWL</abbr> Web Ontology Language is designed for use by applications that need to process the content of information instead of just presenting information to humans. <abbr title="Web Ontology Language">OWL</abbr> facilitates greater machine interpretability of Web content than that supported by <abbr title="eXtensible Markup Language">XML</abbr>, <abbr title="Resource Description Framework">RDF</abbr>, and <abbr title="Resource Description Framework">RDF</abbr> Schema (<abbr title="Resource Description Framework Schema">RDF-S</abbr>) by providing additional vocabulary along with a formal semantics.</p>
<ul>
<li><a href="http://www.w3.org/TR/owl-features/" title="World Wide Web Consortium: OWL Web Ontology Language" target="_blank" rel="nofollow">http://www.w3.org/TR/owl-features/</a></li>
<li><a href="http://en.wikipedia.org/wiki/Web_Ontology_Language" title="Wikipedia: Web Ontology Language" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Web_Ontology_Language</a></li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Dublin Core Metadata Initiative (<abbr title="Dublin Core Metadata Initiative">DCMI</abbr>)</h3>
<p>The Dublin Core set of metadata elements provides a small and fundamental group of text elements through which most resources can be described and catalogued. Using only 15 base text fields, a Dublin Core metadata record can describe physical resources such as books, digital materials such as video, sound, image, or text files, and composite media like web pages. Metadata records based on Dublin Core are intended to be used for cross-domain information resource description and have become standard in the fields of library science and computer science. Implementations of Dublin Core typically make use of <abbr title="eXtensible Markup Language">XML</abbr> and are Resource Description Framework (<abbr title="Resource Description Framework">RDF</abbr>) based.</p>
<ul>
<li><a href="http://dublincore.org" title="Dublin Core Metadata Initiative" target="_blank" rel="nofollow">http://dublincore.org</a></li>
<li><a href="http://en.wikipedia.org/wiki/Dublin_core" title="Wikipedia: Dublin Core" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Dublin_core</a></li>
</ul>
<h3>Triplestore</h3>
<p>A triplestore is a purpose-built database for the storage and retrieval of Resource Description Framework (<abbr title="Resource Description Framework">RDF</abbr>) metadata.</p>
<p>Much like a relational database, information is stored in a triplestore and retrieved via a query language called <abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr>. Unlike a relational database, a triplestore is optimised for the storage and retrieval of many short statements called triples, in the form of subject-predicate-object, like &#8220;Bob is 35&#8243; or &#8220;Bob knows Fred&#8221;.</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Triplestore" title="Wikipedia: Triplestore" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Triplestore</a></li>
</ul>
<h3>SPARQL Protocol and RDF Query Language (<abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr>)</h3>
<p><abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr> is an <abbr title="Resource Description Framework">RDF</abbr> query language, which can be used to express queries across diverse data sources, whether the data is stored natively as <abbr title="Resource Description Framework">RDF</abbr> or viewed as <abbr title="Resource Description Framework">RDF</abbr> via middleware. <abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr> contains capabilities for querying required and optional graph patterns along with their conjunctions and disjunctions. <abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr> also supports extensible value testing and constraining queries by source <abbr title="Resource Description Framework">RDF</abbr> graph. The results of <abbr title="SPARQL Protocol and RDF Query Language">SPARQL</abbr> queries can be results sets or <abbr title="Resource Description Framework">RDF</abbr> graphs.</p>
<ul>
<li><a href="http://www.w3.org/TR/rdf-sparql-query/" title="World Wide Web Consortium: SPARQL Query" target="_blank" rel="nofollow">http://www.w3.org/TR/rdf-sparql-query/</a></li>
<li><a href="http://en.wikipedia.org/wiki/Sparql" title="Wikipedia: SPARQL" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Sparql</a></li>
</ul>
<h3>Simple Knowledge Organization System (<abbr title="Simple Knowledge Organization System">SKOS</abbr>) </h3>
<p><abbr title="Simple Knowledge Organization System">SKOS</abbr> is a family of formal languages designed for representation of thesauri, classification schemes, taxonomies, subject-heading systems, or any other type of structured controlled vocabulary. <abbr title="Simple Knowledge Organization System">SKOS</abbr> is built upon <abbr title="Resource Description Framework">RDF</abbr> and <abbr title="Resource Description Framework Schema">RDF-S</abbr>, and its main objective is to enable easy publication of controlled structured vocabularies for the Semantic Web.</p>
<ul>
<li><a href="http://www.w3.org/2004/02/skos/" title="World Wide Web Consortium: SKOS" target="_blank" rel="nofollow">http://www.w3.org/2004/02/skos/</a></li>
<li><a href="http://en.wikipedia.org/wiki/Simple_Knowledge_Organization_System" title="Wikipedia: Simple Knowledge Organisation System" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Simple_Knowledge_Organization_System</a></li>
</ul>
<h3>Persistent Uniform Resource Locator (<abbr title="Persistent Uniform Resource Locator">PURL</abbr>)</h3>
<p>A <abbr title="Persistent Uniform Resource Locator">PURL</abbr> is a type of Uniform Resource Locator (<abbr title="Uniform Resource Locator">URL</abbr>) that does not directly describe the location of the resource to be retrieved but instead describes an intermediate, more persistent location which, when retrieved, results in redirection (e.g. via a 302 <abbr title="HyperText Transfer Protocol">HTTP</abbr> status code) to the current location of the final resource.</p>
<p><abbr title="Persistent Uniform Resource Locator">PURLs</abbr> are an interim measure, while Uniform Resource Names (<abbr title="Uniform Resource Names">URNs</abbr>) are being mainstreamed, to solve the problem of transitory <abbr title="Uniform Resource Identifier">URIs</abbr> in location-based <abbr title="Uniform Resource Identifier">URI</abbr> schemes like <abbr title="HyperText Transfer Protocol">HTTP</abbr>.</p>
<ul>
<li><a href="http://purl.org/docs/index.html" title="Persistent Uniform Resource Locators" target="_blank" rel="nofollow">http://purl.org/docs/index.html</a></li>
<li><a href="http://en.wikipedia.org/wiki/Persistent_Uniform_Resource_Locator" title="Wikipedia: Persistent Uniform Resource Locator" target="_blank" rel="nofollow">http://en.wikipedia.org/wiki/Persistent_Uniform_Resource_Locator</a></li>
</ul>
<h3>Thomson Reuters OpenCalais</h3>
<p>OpenCalais is a rapidly growing toolkit of capabilities that allow you to readily incorporate state-of-the-art semantic functionality within your blog, content management system, website or application.</p>
<p>The OpenCalais Web Service automatically creates rich semantic metadata for the content you submit. Using Natural Language Processing (<abbr title="Natural Language Processing">NLP</abbr>), machine learning and other methods, Calais analyses your document and finds the entities within it. Calais goes beyond classic entity identification returning the facts and events hidden within your text as well.</p>
<ul>
<li><a href="http://www.opencalais.com" title="Thomson Reuters OpenCalais" target="_blank" rel="nofollow">http://www.opencalais.com</a></li>
</ul>
<p>If you have any more suggestions that should be included above, I&#8217;ll be happy to hear them.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/an-introduction-to-the-semantic-web/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Your Application &#8211; PCI DSS Specifications</title>
		<link>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications</link>
		<comments>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications#comments</comments>
		<pubDate>Mon, 26 Jan 2009 11:19:37 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[American Express]]></category>
		<category><![CDATA[anti-virus software]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[BlueDragon]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[company processing]]></category>
		<category><![CDATA[compliance]]></category>
		<category><![CDATA[control measures]]></category>
		<category><![CDATA[Data Security Standard]]></category>
		<category><![CDATA[database server]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Discover Financial Services]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JCB International]]></category>
		<category><![CDATA[Manitoba]]></category>
		<category><![CDATA[Mastercard Worldwide]]></category>
		<category><![CDATA[Payment Card Industry]]></category>
		<category><![CDATA[Payment Card Industry Security Standards Council]]></category>
		<category><![CDATA[payment card processing]]></category>
		<category><![CDATA[Payment Processors]]></category>
		<category><![CDATA[PCI DSS]]></category>
		<category><![CDATA[public networks]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[raw processing]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[regulations]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[secure systems]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Security Standards Council]]></category>
		<category><![CDATA[security systems]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[software developers]]></category>
		<category><![CDATA[software releases]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[the Council]]></category>
		<category><![CDATA[Visa]]></category>
		<category><![CDATA[Visa Inc .]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web application developers]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web code]]></category>
		<category><![CDATA[Web Servers]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1785</guid>
		<description><![CDATA[PCI DSS stands for Payment Card Industry Data Security Standard, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (PCI SSC). The PCI security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be PCI DSS compliant.]]></description>
			<content:encoded><![CDATA[<p>PCI DSS stands for <a href="https://www.pcisecuritystandards.org/" title="Payment Card Industry Data Security Standard website" target="_blank" rel="nofollow">Payment Card Industry Data Security Standard</a>, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (<abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr>). The <abbr title="Payment Card Industry">PCI</abbr> security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> compliant.</p>
<p><a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png"><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png" alt="Types of Data on a Payment Card" title="Types of Data on a Payment Card" width="600" height="255" class="aligncenter size-full wp-image-1815" /></a></p>
<p>The <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> (<q>Council</q>) is responsible for managing the security standards, while compliance with the <abbr title="Payment Card Industry">PCI</abbr> set of standards is enforced by the founding members of the Council: <a href="http://www.americanexpress.com/datasecurity" title="American Express" target="_blank" rel="nofollow">American Express</a>, <a href="http://www.discovernetwork.com/fraudsecurity/disc.html" title="Discover Financial Services" target="_blank" rel="nofollow">Discover Financial Services</a>, <a href="http://www.jcb-global.com/english/pci/index.html" title="JCB International" target="_blank" rel="nofollow">JCB International</a>, <a href="http://www.mastercard.com/sdp" title="MasterCard Worldwide" target="_blank" rel="nofollow">MasterCard Worldwide</a> and <a href="http://www.visa.com/cisp" title="Visa" target="_blank" rel="nofollow">Visa Inc</a>. Non-compliant companies who maintain a relationship with one or more of the card brands, either directly or through an acquirer risk losing their ability to process credit card payments and being audited and/or fined.</p>
<p>All in-scope companies must validate their compliance annually. This validation can be conducted by Qualified Security Assessors, i.e. companies that have completed a <a href="https://www.pcisecuritystandards.org/qsa_asv/become_qsa.shtml" title="PCI: Becoming a Qualified Security Assessor" target="_blank" rel="nofollow">three-step certification process</a> by the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> which recognises them as being qualified to assess compliance to the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> standard. However, smaller companies have the option to use a <a href="https://www.pcisecuritystandards.org/saq/index.shtml" title="PCI Self-Assessment Questionnaire" target="_blank" rel="nofollow">Self-Assessment Questionnaire</a>. Whether this questionnaire needs to be validated by a <abbr title="Qualified Security Assessors">QSA</abbr> depends on the requirements of the card brands in that merchant&#8217;s region.</p>
<p>The current version of the standard specifies 12 requirements for compliance, organised into 6 logically related groups, which are called &#8220;control objectives.&#8221;</p>
<ol>
<li>Build and Maintain a Secure Network
<ul>
<li>Requirement 1: Install and maintain a firewall configuration to protect cardholder data</li>
<li>Requirement 2: Do not use vendor-supplied defaults for system passwords and other security parameters</li>
</ul>
</li>
<li>Protect Cardholder Data
<ul>
<li>Requirement 3: Protect stored cardholder data</li>
<li>Requirement 4: Encrypt transmission of cardholder data across open, public networks</li>
</ul>
</li>
<li>Maintain a Vulnerability Management Program
<ul>
<li>Requirement 5: Use and regularly update anti-virus software</li>
<li>Requirement 6: Develop and maintain secure systems and applications</li>
</ul>
</li>
<li>Implement Strong Access Control Measures
<ul>
<li>Requirement 7: Restrict access to cardholder data by business need-to-know</li>
<li>Requirement 8: Assign a unique ID to each person with computer access</li>
<li>Requirement 9: Restrict physical access to cardholder data</li>
</ul>
</li>
<li>Regularly Monitor and Test Networks
<ul>
<li>Requirement 10: Track and monitor all access to network resources and cardholder data</li>
<li>Requirement 11: Regularly test security systems and processes</li>
</ul>
</li>
<li>Maintain an Information Security Policy
<ul>
<li>Requirement 12: Maintain a policy that addresses information security</li>
</ul>
</li>
</ol>
<p>Compliance with these requirements can be summarized into 3 main stages:</p>
<ul>
<li>Collecting and storing: Secure collection and tamper-proof storage of all log data so that it is available for analysis.</li>
<li>Reporting: Being able to prove compliance on the spot if audited and present evidence that controls are in place for protecting data.</li>
<li>Monitoring and alerting: Have systems in place such as auto-alerting, to help administrators constantly monitor access and usage of data. Administrators are warned of problems immediately and can rapidly address them. These systems should also extend to the log data itself –- there must be proof that log data is being collected and stored.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>What does this actually mean for web application developers?</h3>
<p>It is considerably more expensive and more time-consuming to recover from a security incident than to take preventative measures ahead of time. If you follow the guidelines below, you will go along way to securing you application in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations. Many of the measures apply to general application security, but since <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> is all about security, they are worth mentioning.</p>
<p>Server-level Security:</p>
<ul>
<li>Separate web- and database-servers on to different physical machines.</li>
<li>Secure the web- and database-servers with traditional techniques. Only authorised accounts should have the capabilities to run tasks on the machine. That means not giving admin-rights to the user account.</li>
<li>Keep servers up-to-date with the latest patches and software releases.</li>
<li>Minimise the number of services running on the server. This means limiting the services to only those required for the web- or database-servers to function.</li>
<li>Secure information in transit between servers. This may mean physically securing the network to prevent evesdropping via encryption or obfuscating the data amongst innocuous &#8216;noise&#8217;.</li>
<li>Secure the database server behind a firewall.</li>
</ul>
<p>Application-level Security:</p>
<ul>
<li>Separate ColdFusion, the webserver and database server user accounts. They should never be under the same system account.</li>
<li>Create a database user specifically for your ColdFusion datasource and restrict it to only the activities required for the application. The user should not have database-owner rights, access to databases not relating to the application or access to the system tables.</li>
<li>Revoke privileges in the ColdFusion datasource definition to prevent the <abbr title="Structured Query Language">SQL</abbr> commands <code>CREATE</code>, <code>DROP</code>, <code>GRANT</code>, <code>REVOKE</code> and <code>ALTER</code>.</li>
<li>General settings in the ColdFusion Administrator:
<ul>
<li>Check the <em>Disable access to internal ColdFusion Java components</em> option.</li>
<li>Check the <em>Enable Global Script Protection</em> option.</li>
<li>Add a <em>Missing Template Handler</em>.</li>
<li>Add a <em>Site-wide Error Handler</em>.</li>
<li>Reduce the <em>Maximum size of post data</em> from 100<abbr title="megabytes">MB</abbr>.</li>
<li>Enable <em>Timeout Requests</em>, and set to 60 seconds or less.</li>
<li>Disable <em>Robust Exception Handling</em> on production servers.</li>
</ul>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Web Application-level Security:</p>
<ul>
<li>Use secure HTTP to transfer data and/or when logged into &#8216;administration&#8217; secutions of your web application.</li>
<li>Timeout sessions after 15 minutes and on browser close.</li>
<li>Provide multi-level login processes. For example, lock the application after 3 failed attempts for a period of 10 minutes.</li>
<li>Do not identify whether the username or password are incorrect, simply notify the user that their login failed and that they must try again.</li>
<li>Encrypt passwords stored in the database with a standard such as <a href="http://en.wikipedia.org/wiki/SHA_hash_functions" title="Wikipedia: SHA cryptographic has function" target="_blank" rel="nofollow">SHA-256</a> or &#8216;stronger&#8217;.</li>
<li>Use <a href="http://en.wikipedia.org/wiki/Captcha" title="Wikipedia: CAPTCHA" target="_blank" rel="nofollow">CAPTCHA</a>s (textual and aural) to prevent automated robots hacking into your application.</li>
<li>Run regular penetration tests on your application to identify potential problems.</li>
<li>Encrypt credit card information held in the database or other storage mechanism. Only store credit card data in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations.</li>
</ul>
<p>Code-level Security:</p>
<ul>
<li>Application.cfc &#8211; Set the <code>scriptProtect</code> Application variable to <code>true</code> to enable application-wide cross-site script protection.
</li>
<li>CFQueryParam &#8211; This tag, importantly, verifies the data type of a query parameter and, for <abbr title="Relational Database Management Systems">RDBMS</abbr>s that support bind variables, enables ColdFusion to use bind variables in the <acronym title="Structured Query Language">SQL</acronym> statement. Bind variable usage enhances performance when executing a <code>cfquery</code> statement multiple times. There are limitations to the use of the <code>cfqueryparam</code> tag. In ColdFusion 7 for example, you cannot use them in queries using the <code>cachedWithin</code> attribute. Similarly, they cannot be used in <code>ORDER BY</code> clauses, although the use of conditional logic should resolve the need for order by variables.
</li>
<li>Functions &#8211; As a rule of thumb, validate <em>all</em> the data being passed into a query prior to it being used. ColdFusion MX 7 saw the introduction of the <code>isValid()</code> function. This function tests whether a value meets a validation or data type rule and can be used to replace a large number of type-specific functions such as <code>isArray()</code>, <code>isBinary()</code>, <code>isBoolean()</code>, <code>isDate()</code>, <code>isNumeric()</code> and <code>isSimpleValue()</code> etc.
</li>
<li>Stored Procedures &#8211; I often favour the use of stored procedures over standard queries. Not only do they add an additional level of performance, they provide an additional level of security; ColdFusion does not do any raw processing of queries in the web code, it simply passes variables down the wire to the database server.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Conclusion</h3>
<p>The goal of the <abbr title="Payment Card Industry">PCI</abbr> Data Security Standard is to protect cardholder data that is processed, stored or transmitted by merchants. The security controls and processes required by <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> are vital for protecting cardholder account data, including the <abbr title="primary account number">PAN</abbr> &#8211; the primary account number printed on the front of a payment card. Merchants and any other service providers involved with payment card processing must never store sensitive authentication data after authorisation. This includes sensitive data that is printed on a card, or stored on a card’s magnetic stripe or chip &#8211; and personal identification numbers entered by the cardholder.</p>
<p>By following the points made above, you will go a long way to meeting the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> guidelines, whilst also securing your infrastructure and applications in a more general sense.</p>
<p><strong>Caveat:</strong> The views and comments written in this article are provided as a guideline. I hold no responsibility for the security of your applications and data based upon the information provided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Search Engine Safe URLs with Apache and htaccess</title>
		<link>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess</link>
		<comments>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess#comments</comments>
		<pubDate>Mon, 08 Dec 2008 15:57:15 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[All]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ColdBox]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Fusebox]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[ISAPI]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[New Brunswick]]></category>
		<category><![CDATA[None]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[search engine optimisation]]></category>
		<category><![CDATA[search engine robots]]></category>
		<category><![CDATA[search engine safe]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[URL rewriting]]></category>
		<category><![CDATA[USD]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1635</guid>
		<description><![CDATA[An increasingly popular technique among websites and in particular, blogs, is the idea of making URLs search engine friendly, or safe, on the premise that doing so will help search engine optimisation. By removing the obscure query string element of a URL and replacing it with keyword rich alternatives, not only makes it more readable for a human being, but also the venerable robots that allow our page content to be found in the first place.]]></description>
			<content:encoded><![CDATA[<p>An increasingly popular technique among websites and in particular, blogs, is the idea of making <abbr title="Universal Resource Locator">URL</abbr>s search engine friendly, or safe, on the premise that doing so will help search engine optimisation. By removing the obscure query string element of a <abbr title="Universal Resource Locator">URL</abbr> and replacing it with keyword rich alternatives, not only makes it more readable for a human being, but also the venerable robots that allow our page content to be found in the first place.</p>
<p>For example, the following is WordPress&#8217; default URL configuration for a post:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.domain.com/?p=1635</pre></div></div>

<p>However, buy using a URL-rewriting available in the Apache webserver, we can achieve a far better result, such as the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.domain.com/search-engine-safe-urls</pre></div></div>

<p>NB. It is also possible to achieve a similar result with an <abbr title="Internet Server Application Programming Interface">ISAPI</abbr> rewrite for Microsoft&#8217;s <abbr title="Internet Information Server">IIS</abbr> webserver, but this topic will not be included in this post.</p>
<p>To get your website working with <abbr title="search engine safe">SES</abbr> <abbr title="Universal Resource Locator">URL</abbr>s you need to enable both the <code>mod_rewite</code> module and <code>AllowOverride</code> directive in the Apache configuration file.</p>
<p>Uncomment (remove #) from the following to enable the re-write rule:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">LoadModule rewrite_module modules/mod_rewrite.so</pre></div></div>

<p>Change the <code>AllowOverride</code> directive from none to all</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;directory /&gt;
    Options FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all
&lt;/directory&gt;
&nbsp;
&lt;directory &quot;C:/WebRoot&quot;&gt;
    # Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
&nbsp;
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All
&nbsp;
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
&lt;/directory&gt;</pre></div></div>

<p>On Apache webservers, <code>.htaccess</code> (hypertext access) is the default name of directory-level configuration files. An <code>.htaccess</code> file is placed in a particular directory, and the directives in the <code>.htaccess</code> file apply to that directory, and all its subdirectories. It provides the ability to customize configuration for requests to the particular directory. In our case, enabling search engine safe (<abbr title="search engine safe">SES</abbr>) <abbr title="Universal Resource Locator">URL</abbr>s.</p>
<p>By setting the <code>AllowOverride</code> directive to <q>All</q> in effect defers configuration settings to the <code>.htaccess</code> file.</p>
<p>An example <code>.htaccess</code> file could include the following code to rewrite the URLs:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]</pre></div></div>

<p>Search engine friendly <abbr title="Universal Resource Locator">URL</abbr>s are implemented with Rewrite engines. The rewrite engine modifies the <abbr title="Universal Resource Locator">URL</abbr> based upon a number of rewrite conditions and rules.</p>
<p>The <code>RewriteBase</code> directive explicitly sets the base <abbr title="Universal Resource Locator">URL</abbr> for per-directory rewrites. The <code>RewriteCond</code> directive defines a rule condition, so in this case handling missing files or directories. Finally, the <code>RewriteRule</code> directive is the real rewriting workhorse. In this example, we&#8217;re getting everything in the <abbr title="Uniform Resource Identifier">URI</abbr> &#8212; i.e. not including the protocol (HTTP/S) and domain name &#8212; based upon a regular expression. This is then appended to the default file reference &#8212; index.php &#8212; as a <a href="http://www.regular-expressions.info/brackets.html" title="Regular Expression: back references" target="_blank" rel="nofollow">back reference</a>. The <code>[L,QSA]</code> refers to the rule being the last rule and append any query string parameters to the default file. It is important to note that this is all done on the server side, the user will never see the website address changing in the browser&#8217;s address bar. Furthermore, simply transposing the index.php filename with your default file name &#8212; e.g. index.cfm, default.aspx &#8212; will have the same result. Indeed, the above rewrite rules are becoming a de-facto standard for web applications.</p>
<p>To fully understand <code>mod_rewrite</code> rules above, look at the <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html" title="Apache mod_rewrite documentation" target="_blank" rel="nofollow">Apache mod_rewrite documentation</a>.</p>
<p>Once you have your <abbr title="Search Engine Safe">SES</abbr> functionality in place on the webserver, it is then the responsibility of your application framework to understand the <abbr title="Universal Resource Locator">URL</abbr> construction and handle it accordingly. Fortunately, frameworks such as <a href="http://www.coldboxframework.com" title="ColdBox Framework" target="_blank" rel="nofollow">ColdBox</a> and <a href="http://www.fusebox.org" title="Fusebox Framework" target="_blank" rel="nofollow" >Fusebox</a> for ColdFusion, <a href="http://framework.zend.com" title="Zend PHP framework" target="_blank" rel="nofollow">Zend</a> and <a href="http://www.symfony-project.com" title="Symfony PHP fraemwork" target="_blank" rel="nofollow">Symfony</a> for <abbr title="PHP Hypertext Precursor">PHP</abbr>, all contain functionality to do this, but that is the subject of an entirely different post.</p>
<p>Users of web applications prefer short, neat <abbr title="Universal Resource Locator">URL</abbr>s to raw query string parameters. A concise <abbr title="Universal Resource Locator">URL</abbr> is easy to remember, and less time-consuming to type in. If the <abbr title="Universal Resource Locator">URL</abbr> can be made to relate clearly to the content of the page, then errors are not only less likely to happen, but our good friends the search engine robots are able to draw a stronger assumption of the pages&#8217; relevance and content.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/enabling-search-engine-safe-urls-with-apache-and-htaccess/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What&#039;s In Google Chrome&#039;s User-Agent String</title>
		<link>http://www.simonwhatley.co.uk/whats-in-google-chromes-user-agent-string</link>
		<comments>http://www.simonwhatley.co.uk/whats-in-google-chromes-user-agent-string#comments</comments>
		<pubDate>Fri, 12 Sep 2008 12:10:43 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chrome's address bar]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HyperText Transfer Protocol]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Internet users]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft Vista]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[mobile phones]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Official Build Google Inc.]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[United States]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[User Agent]]></category>
		<category><![CDATA[web crawlers]]></category>
		<category><![CDATA[Web Standards era]]></category>
		<category><![CDATA[webmaster]]></category>
		<category><![CDATA[windowing system]]></category>
		<category><![CDATA[Windows NT]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1123</guid>
		<description><![CDATA[With the advent Google Chrome there has been a lot of media coverage regarding the browser’s uptake and how it will compete with Internet Explorer, Firefox and Safari. This is where the User Agent becomes most valuable.]]></description>
			<content:encoded><![CDATA[<p>With the advent <a href="http://www.google.com/chrome/" title="" target="_blank" rel="nofollow">Google Chrome</a> there has been a lot of media coverage regarding the browser&#8217;s uptake and how it will compete with Internet Explorer, Firefox and Safari. This is where the User Agent becomes most valuable. It can be used in analytics software to determine the browser share and consequently aid the development of the website.</p>
<p>But what is a User Agent? A User Agent is the client application used with a particular network protocol; the phrase is most commonly used in reference to those which access the Web. Web user agents range from web browsers and e-mail clients to search engine crawlers (<q>spiders</q>), as well as mobile phones, screen readers and braille browsers used by people with disabilities. When Internet users visit a web site, a text string is generally sent to identify the user agent to the server. This forms part of the <abbr title="HyperText Transfer Protocol">HTTP</abbr> request, prefixed with <strong>user-agent:</strong> and typically includes information such as the application name, version, host operating system, and language. Bots, such as web crawlers, often also include a <abbr title="Universal Resource Locator">URL</abbr> and/or e-mail address so that the webmaster can contact the operator of the bot.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>By simply typing <strong>about:version</strong> into Chrome&#8217;s address bar you will be presented with the following information:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Google Chrome
0.2.149.29 (1798)
Official Build
Google Inc.
Copyright © 2006-2008 Google Inc. All Rights Reserved.
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13</pre></div></div>

<p>As you can see Chrome&#8217;s version information provides limited detail about the browser. The last line is the important one. It is the <abbr title="HyperText Transfer Protocol">HTTP</abbr> <em>User-Agent</em> header:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13.</pre></div></div>

<p>If you know the <a href="http://tools.ietf.org/html/rfc2616" title="RFC 2616 Hypertext Transfer Protocol - HTTP/1.1" target="_blank" rel="nofollow">RFC 2616</a> specification on the HyperText Transfer Protocol &#8212; which incidentally, I gladly don&#8217;t &#8212; you would know that the User Agent, or more formally, product token, should be short and to the point:</p>
<blockquote><p>
Product tokens SHOULD be short and to the point. They MUST NOT be used for advertising or other non-essential information. Although any token character MAY appear in a product-version, this token SHOULD only be used for a version identifier (i.e., successive versions of the same product SHOULD only differ in the product-version portion of  the product value).
</p></blockquote>
<p>Clearly this isn&#8217;t the case! One of Google&#8217;s reason&#8217;s behind creating the Chrome browser was to start afresh. It would have therefore been truely amazing if they had made the string simply <em>Chrome/0.2.149.27</em>.</p>
<p>Unfortunately, <a href="http://en.wikipedia.org/wiki/Browser_sniffing" title="Wikipedia: Browser Sniffing" target="_blank" rel="nofollow">browser sniffing</a> makes an ever-growing <abbr title="User-Agent">UA</abbr> string the path of least resistance for browser vendors.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>So, what does Chrome&#8217;s User Agent string actually mean:</p>
<ul>
<li><strong>Mozilla/</strong> &#8211; This means that browser has the kind of capabilities that Netscape 1.1 had compared to <a href="http://en.wikipedia.org/wiki/Mosaic_(web_browser)" title="Wikipedia: Mosaic Web Browser" target="_blank" rel="nofollow">Mosaic</a> and <a href="http://en.wikipedia.org/wiki/Lynx_(web_browser)" title="Wikipedia: Lynx Web Browser" target="_blank" rel="nofollow">Lynx</a>.</li>
<li><strong>5.0</strong> &#8211; This means that the browser engine is from the post-Browser War Web Standards era as opposed to being from the Browser War era.</li>
<li><strong>(Windows;</strong> &#8211; This means that general windowing system flavor the browser runs on is Windows (as opposed to, for example, Apple and X11).</li>
<li><strong>U;</strong> &#8211; This means that the browser has at least the level of <a href="http://en.wikipedia.org/wiki/User_agent#Encryption_strength_.22U.22_.2F_.22I.22_.2F_.22N.22" title="Wikipedia: Encryption Strength" target="_blank" rel="nofollow">cryptographic capability / encryption strength</a> that U.S. versions of browsers had in the late 1990s.</li>
<li><strong>Windows NT 6.0;</strong> &#8211; This indicates the operating system the browser is running on. In this instance, the browser is running on Vista.</li>
<li><strong>en-US)</strong> &#8211; This indicates the user interface language of the browser (U.S. English in this case). This may be used to choose between different <em>content</em> languages even though <abbr title="HyperText Transfer Protocol">HTTP</abbr> has a different header for that purpose.</li>
<li><strong>AppleWebKit/</strong> &#8211; This indicates that the engine of the browser is <a href="http://webkit.org/" title="Webkit opensource project" target="_blank" rel="nofollow">WebKit</a> as opposed to being <a href="http://developer.mozilla.org/en/Gecko" title="Mozilla: Gecko Layout Engine" target="_blank" rel="nofollow">Gecko</a>. Developers should not do user agent sniffing as a rule, but if they still do, this is what they should be sniffing.</li>
<li><strong>525.13</strong> &#8211; This is the WebKit version from which Chrome branched its copy. Site admins could use this to detect old versions with known bugs.</li>
<li><strong>(KHTML, like Gecko)</strong> &#8211; This introduces the substring <q>Gecko</q> into the <abbr title="User-Agent">UA</abbr> string while pointing out to human readers that Webkit was forked from <a href="http://en.wikipedia.org/wiki/KHTML" title="Wikipedia: KHTML" target="_blank" rel="nofollow">KHTML</a>. Without this substring, Chrome might be put in the same category as <abbr title="Internet Explorer">IE</abbr> and Netscape 4.</li>
<li><strong>Chrome/</strong> &#8211; This string identifies the browser as actually Google Chrome.</li>
<li><strong>0.2.149.27</strong> &#8211; This is the Chrome version. This could be used to detect old versions with known bugs.</li>
<li><strong>Safari/</strong> &#8211; This means that the browser is like Safari as opposed to being like Firefox.</li>
<li><strong>525.13</strong> &#8211; This just repeats the WebKit version in order to have <em>some</em> version but not the irrelevant Safari.app version.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/whats-in-google-chromes-user-agent-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anatomy of the Application.cfc in ColdFusion 8</title>
		<link>http://www.simonwhatley.co.uk/anatomy-of-the-applicationcfc-in-coldfusion-8</link>
		<comments>http://www.simonwhatley.co.uk/anatomy-of-the-applicationcfc-in-coldfusion-8#comments</comments>
		<pubDate>Tue, 18 Mar 2008 09:03:38 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[CFC]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Component]]></category>
		<category><![CDATA[cross-site]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[onApplicationEnd]]></category>
		<category><![CDATA[onApplicationStart]]></category>
		<category><![CDATA[onError]]></category>
		<category><![CDATA[onMissingTemplate]]></category>
		<category><![CDATA[onRequest]]></category>
		<category><![CDATA[onRequestEnd]]></category>
		<category><![CDATA[onRequestStart]]></category>
		<category><![CDATA[onSessionEnd]]></category>
		<category><![CDATA[onSessionStart]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[scopes]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[this]]></category>
		<category><![CDATA[www.domain.com]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=414</guid>
		<description><![CDATA[With the release of ColdFusion MX 7 came the introduction of the Application.cfc ColdFusion component. This component replaced the traditional Application.cfm and OnRequestEnd.cfm ColdFusion application templates. Furthermore, if Application.cfc is present, both of these templates are ignored by the application.

In addition to replacing the Application.cfm, the Application.cfc introduced a number of built in methods that handle specific events. These events, as discussed in detail below, allow for a greater control over events within the application.]]></description>
			<content:encoded><![CDATA[<p>With the release of ColdFusion MX 7 came the introduction of the Application.cfc ColdFusion component. This component replaced the traditional Application.cfm and OnRequestEnd.cfm ColdFusion application templates. Furthermore, if Application.cfc is present, both of these templates are ignored by the application.</p>
<p>In addition to replacing the Application.cfm, the Application.cfc introduced a number of built in methods that handle specific events. These events, as discussed in detail below, allow for a greater control over events within the application.</p>
<h2>Application Variables</h2>
<p>The <code>THIS</code> scope in the Application.cfc contains several built-in variables that allow you to set the properties of the application.</p>
<p>The following <code>cfscript</code> briefly outlines the variables that you can set to control the application&#8217;s behaviour.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #000099;"><span style="color: #800000;">&lt;cfscript&gt;</span></span>
<span style="color: #000099;"><span style="color: #808080;">//the application name (should be unique)</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff;">name</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;ApplicationName&quot;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//how long the application variables persist</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">applicationTimeout</span> <span style="color: #0000ff">=</span> <span style="color: #800080;">createTimeSpan</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">2</span>,<span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">0</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//define whether client variables are enabled</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">clientManagement</span> <span style="color: #0000ff">=</span> false;</span>
<span style="color: #000099;"><span style="color: #808080;">//where should we store them, if enabled?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">clientStorage</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;registry&quot;</span>; <span style="color: #808080;">//cookie||registry||datasource</span></span>
<span style="color: #000099;"><span style="color: #808080;">//define where cflogin information should persist</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">loginStorage</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;session&quot;</span>; <span style="color: #808080;">//cookie||session</span></span>
<span style="color: #000099;"><span style="color: #808080;">//define whether session variables are enabled</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">sessionManagement</span> <span style="color: #0000ff">=</span> true;</span>
<span style="color: #000099;"><span style="color: #808080;">//how long the session variables persist?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">sessionTimeout</span> <span style="color: #0000ff">=</span> <span style="color: #800080;">createTimeSpan</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">0</span>,<span style="color: #ff0000;">20</span>,<span style="color: #ff0000;">0</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//define whether to set cookies on the browser?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">setClientCookies</span> <span style="color: #0000ff">=</span> true;</span>
<span style="color: #000099;"><span style="color: #808080;">//should cookies be domain specific</span></span>
<span style="color: #000099;"><span style="color: #808080;">//i.e. *.domain.com or www.domain.com</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">setDomainCookies</span> <span style="color: #0000ff">=</span> false;</span>
<span style="color: #000099;"><span style="color: #808080;">//should we try to block cross-site scripting?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">scriptProtect</span> <span style="color: #0000ff">=</span> false;</span>
<span style="color: #000099;"><span style="color: #808080;">//should we secure our JSON calls?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">secureJSON</span> <span style="color: #0000ff">=</span> false;</span>
<span style="color: #000099;"><span style="color: #808080;">//use a prefix in front of JSON strings?</span></span>
<span style="color: #000099;">THIS.<span style="color: #0000ff">secureJSONPrefix</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;&quot;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//used to help ColdFusion work with missing files</span></span>
<span style="color: #000099;"><span style="color: #808080;">//and directory indexes. tells ColdFusion not to call</span></span>
<span style="color: #000099;"><span style="color: #808080;">//onMissingTemplate method.</span></span>
<span style="color: #000099;">THIS.welcomeFi<span style="color: #0000ff;">le</span>L<span style="color: #0000ff;">is</span>t <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;&quot;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//define custom coldfusion mappings.</span></span>
<span style="color: #000099;"><span style="color: #808080;">//Keys are mapping names, values are full paths</span></span>
<span style="color: #000099;">THIS.mappings <span style="color: #0000ff">=</span> <span style="color: #800080;">structNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;"><span style="color: #808080;">//define a list of custom tag paths.</span></span>
<span style="color: #000099;">THIS.customTagPaths <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;&quot;</span>;</span>
<span style="color: #000099;"><span style="color: #800000;">&lt;/cfscript&gt;</span></span></pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>Method Summary</h2>
<p>Below is a brief discussion of the built-in event methods available to the Application.cfc. Since the Application.cfc is a regular ColdFusion component, you can also implement your own methods alongside the built in ones (assuming the names are uniquely different).</p>
<h3>The onApplicationStart Method</h3>
<p>Runs when the application first starts up: when the first request for a page is processed or the first <acronym title="ColdFusion Component">CFC</acronym> method is invoked by an event.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onApplicationStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;boolean&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000ff;">&lt;</span>cfreturn true <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method is typically used to initialise code; for example to to set variables, such as datasource, into the <code>APPLICATION</code> scope, or create <a href="http://en.wikipedia.org/wiki/Singleton_pattern" title="Singleton Design Pattern" target="_blank" rel="nofollow">Singleton</a> instances of ColdFusion components.</p>
<p>For example:</p>
<p>The following example creates structures in tha application scope to store general configuration settings and Singleton objects that can be later referenced by the application framework.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onApplicationStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;boolean&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #000099;"><span style="color: #800000;">&lt;cfscript&gt;</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// INITIALISE CONFIGURATION VARIABLES AND APPLICATION BUSINESS COMPONENTS</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// **********************************************************************</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// LOAD COMMON SITE VARIABLES INTO APPLICATION SCOPE</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// create structure to hold configuration settings</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strConfig <span style="color: #0000ff">=</span> <span style="color: #800080;">structNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #808080;">//site-wide datasource(s)</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strConfig.<span style="color: #0000ff">datasource</span> <span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;DatasourceName&quot;</span>;</span>
<span style="color: #000099;">	<span style="color: #808080;">// default records per page for pagination</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strConfig.rec<span style="color: #0000ff;">or</span>dsPerPa<span style="color: #0000ff;">ge</span> <span style="color: #0000ff">=</span> <span style="color: #ff0000;">15</span>;</span>
<span style="color: #000099;">	<span style="color: #808080;">// **********************************************************************</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// LOAD PERSISTENT OBJECTS INTO APPLICATION SCOPE</span></span>
<span style="color: #000099;">	<span style="color: #808080;">// data for object instantiation</span></span>
<span style="color: #000099;">	strArgs	<span style="color: #0000ff">=</span> <span style="color: #800080;">structNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; <span style="color: #808080;">// flush strArgs</span></span>
<span style="color: #000099;">	strArgs.<span style="color: #0000ff">datasource</span> <span style="color: #0000ff">=</span> <span style="color: #0000ff">APPLICATION</span>.strConfig.<span style="color: #0000ff">datasource</span>;</span>
&nbsp;
<span style="color: #000099;">	<span style="color: #808080;">// create structure to hold objects</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs <span style="color: #0000ff">=</span> <span style="color: #800080;">structNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs.objUserMana<span style="color: #0000ff;">ge</span>r <span style="color: #0000ff">=</span> <span style="color: #800080;">createObject</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;component&quot;</span>,<span style="color: #009900;">&quot;com.whatley.user.UserManager&quot;</span><span style="color: #000000;">&#41;</span>.init<span style="color: #000000;">&#40;</span><span style="color: #0000ff">argumentCollection</span><span style="color: #0000ff;">=</span>strArgs<span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #808080;">//etc...</span></span>
&nbsp;
<span style="color: #000099;">	<span style="color: #808080;">// instantiate utility service objects</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs.objEmailServices <span style="color: #0000ff">=</span> <span style="color: #800080;">createObject</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;component&quot;</span>,<span style="color: #009900;">&quot;com.whatley.service.Email&quot;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs.objFi<span style="color: #0000ff;">le</span>Services <span style="color: #0000ff">=</span> <span style="color: #800080;">createObject</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;component&quot;</span>,<span style="color: #009900;">&quot;com.whatley.service.File&quot;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs.objQueryServices <span style="color: #0000ff">=</span> <span style="color: #800080;">createObject</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;component&quot;</span>,<span style="color: #009900;">&quot;com.whatley.service.Query&quot;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #808080;">//etc...</span></span>
&nbsp;
<span style="color: #000099;">	<span style="color: #808080;">// native coldfusion objects</span></span>
<span style="color: #000099;">	<span style="color: #0000ff">APPLICATION</span>.strObjs.objServiceFact<span style="color: #0000ff;">or</span>y <span style="color: #0000ff">=</span> <span style="color: #800080;">createObject</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;java&quot;</span>,<span style="color: #009900;">&quot;coldfusion.server.ServiceFactory&quot;</span><span style="color: #000000;">&#41;</span>;</span>
&nbsp;
<span style="color: #000099;">	<span style="color: #808080;">// **********************************************************************</span></span>
<span style="color: #000099;">	return true;</span>
<span style="color: #000099;">	<span style="color: #800000;">&lt;/cfscript&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>Since the objects above are created as Singletons, we do not have to create or destroy objects throughout the application, but simply reference the object held in memory. This is efficient, but of course, would not be suitable for per-session objects, such as shopping carts.</p>
<p>For example:</p>
<p>Referencing and invoking an object from the <code>APPLICATION</code> scope:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfinvoke</span> <span style="color: #0000ff;">object</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;APPLICATION.strObjs.objUserManager&quot;</span> <span style="color: #0000ff;">method</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;getUser&quot;</span> <span style="color: #0000ff">returnvariable</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;qryGetUser&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;userId&quot;</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#SESSION.strUser.userId#&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cfinvoke&gt;</span></span></pre></div></div>

<h3>The onApplicationEnd Method</h3>
<p>Runs when the application stops: when the application times out or the service is stopped.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onApplicationEnd&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;applicationScope&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method is typically used to clean-up currently activities, save the current state of the application to a database or log the application&#8217;s end to a file. The latter can be useful to help determine when and why an application ended.</p>
<p>Below is a simple example of how you could implement a simple log:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onApplicationEnd&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;applicationScope&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #800000;">&lt;cflog</span> <span style="color: #0000ff">file</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#THIS.Name#&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;Information&quot;</span></span>
<span style="color: #333333;">        	<span style="color: #0000ff;">text</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;Application #ARGUMENTS.applicationScope.applicationName# Ended&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>Notes:</p>
<ul>
<li>The method is not associated with an individual request so you cannot use it to display data to a user.</li>
<li>If you call this method explicity, ColdFusion does not end the application, but does execute the code within the method.</li>
<li>The method can access the <code>SERVER</code> scope directly, but does not have access to the <code>SESSION</code> and <code>REQUEST</code> scopes.</li>
</ul>
<h3>The onMissingTemplate Method</h3>
<p>Triggered when the user requests a ColdFusion template that doesn&#8217;t exist.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onMissingTemplate&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;boolean&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;targetpage&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000ff;">&lt;</span>cfreturn true <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>ColdFusion invokes this method when it encounters a file not found condition, that is, when a URL specifies a <acronym title="ColdFusion Markup Language">CFML</acronym> page that does not exist. This is an important addition to ColdFusion 8 and allows missing template errors (also known as <a href="http://en.wikipedia.org/wiki/HTTP_404" title="HTTP 404 Error" target="_blank" rel="nofollow">HTTP 404</a> errors) to be captured more efficiently by the application framework.</p>
<h3>The onRequestStart Method</h3>
<p>Runs before the request is processed.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onRequestStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;boolean&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;thePage&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000ff;">&lt;</span>cfreturn true <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method is great for user authorisation and login handling and for request specific variable initialisation. For example, you could use this method to log statistics to a database (performance and usage).</p>
<p>As this method runs at the beginning of a request, we can also use it to fire other events. In the example below, I reinitialise the Application which enables me to refresh objects held in memory that may have changed during code development or release.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onRequestStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #000099;"><span style="color: #800000;">&lt;cfscript&gt;</span></span>
<span style="color: #000099;">	<span style="color: #808080;">//flush the application scope</span></span>
<span style="color: #000099;">	<span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>CGI.server_name <span style="color: #0000ff">=</span><span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;localhost&quot;</span><span style="color: #000000;">&#41;</span> || <span style="color: #000000;">&#40;</span><span style="color: #800080;">structKeyExists</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff">URL</span>,<span style="color: #009900;">'refresh'</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">&amp;&amp;</span> <span style="color: #800080;">structKeyExists</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff">URL</span>,<span style="color: #009900;">'password'</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">&amp;&amp;</span> <span style="color: #0000ff">URL</span>.<span style="color: #0000ff">password</span> <span style="color: #0000ff">=</span><span style="color: #0000ff">=</span> <span style="color: #009900;">&quot;p455w0rd&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></span>
<span style="color: #000099;">	<span style="color: #000000;">&#123;</span></span>
<span style="color: #000099;">		onApplicationStart<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	<span style="color: #000000;">&#125;</span></span>
<span style="color: #000099;">	return true;</span>
<span style="color: #000099;">	<span style="color: #800000;">&lt;/cfscript&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<h3>The onRequest Method</h3>
<p>Runs before the request is processed, but after onRequestStart.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onRequest&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;thePage&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfinclude</span> <span style="color: #0000ff">template</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#ARGUMENTS.thePage#&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This event handler provides an optional request filter mechanism for ColdFusion page requests. Use it to intercept requests to target pages and override the default behavior of running the requested pages. You can use this method to do preprocessing that is required for all requests. Typical uses include filtering and modifying request page contents (such as removing extraneous white space), or creating a switching mechanism that determines the exact page to display based on available parameters.</p>
<h3>The onRequestEnd Method</h3>
<p>Runs at the end of the request when all pages have been processed.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #808080; background-color:#ffff80;">&lt;!--- Runs at end of request ---&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onRequestEnd&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;thePage&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method can be useful for gathering performance metrics, or for displaying dynamic footer information (although I wouldn&#8217;t generally put display code in an Application.cfc).</p>
<p>For example:</p>
<p>Log the <code>CGI</code> variables to a database table.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onRequestEnd&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfset</span> <span style="color: #0000ff;">var</span> qryInsertStats <span style="color: #0000ff">=</span> <span style="color: #800080;">queryNew</span><span style="color: #000000;">&#40;</span><span style="color: #009900;">'tempCol'</span><span style="color: #000000;">&#41;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfquery</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;qryInsertStats&quot;</span> <span style="color: #0000ff">datasource</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#APPLICATION.strConfig.datasource#&quot;</span><span style="color: #800000;">&gt;</span></span>
	INSERT INTO tbl_site_stats (template,query_string,referer,user_agent,remote_addr,datetime)
	VALUES
	(
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#CGI.PATH_INFO#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#CGI.QUERY_STRING#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#CGI.HTTP_REFERER#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#CGI.HTTP_USER_AGENT#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#CGI.REMOTE_ADDR#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#now()#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_datetime&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	)
	<span style="color: #333333;"><span style="color: #800000;">&lt;/cfquery&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<h3>The onError Method</h3>
<p>Triggered when an error is encountered that is not caught by a try/catch block.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #808080; background-color:#ffff80;">&lt;!--- Runs on error ---&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onError&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;exception&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;eventname&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfdump</span> <span style="color: #0000ff;">var</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#ARGUMENTS#&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000ff;">&lt;</span>cfab<span style="color: #0000ff;">or</span>t <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method is used to handle errors in an application-specific manner. This method overrides any error handlers that you set in the ColdFusion Administrator or in cferror tags. It does not override try/catch blocks.</p>
<p>For example:</p>
<p>The following displays a friendly, static error page to the user if it is not a development server whilst also logging the error. If the error is on development, simply dump the error to screen for debugging.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onError&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;exception&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;eventName&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfif</span> CGI.server_name <span style="color: #0000ff;">neq</span> <span style="color: #009900;">&quot;localhost&quot;</span> <span style="color: #0000ff;">and</span> CGI.server_name <span style="color: #0000ff;">neq</span> <span style="color: #009900;">&quot;127.0.0.1&quot;</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #808080; background-color:#ffff80;">&lt;!--- Live application, handle error ---&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfinclude</span> <span style="color: #0000ff">template</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;error/error.htm&quot;</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #808080; background-color:#ffff80;">&lt;!--- Log all errors. ---&gt;</span></span>
	        <span style="color: #333333;"><span style="color: #800000;">&lt;cflog</span> <span style="color: #0000ff">file</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#THIS.Name#&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;error&quot;</span></span>
<span style="color: #333333;">	            <span style="color: #0000ff;">text</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;Event Name: #ARGUMENTS.Eventname#&quot;</span> <span style="color: #800000;">&gt;</span></span>
	        <span style="color: #333333;"><span style="color: #800000;">&lt;cflog</span> <span style="color: #0000ff">file</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#THIS.Name#&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;error&quot;</span></span>
<span style="color: #333333;">	            <span style="color: #0000ff;">text</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;Message: #ARGUMENTS.Exception.message#&quot;</span><span style="color: #800000;">&gt;</span></span>
	        <span style="color: #333333;"><span style="color: #800000;">&lt;cflog</span> <span style="color: #0000ff">file</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#THIS.Name#&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;error&quot;</span></span>
<span style="color: #333333;">	            <span style="color: #0000ff;">text</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;Root Cause Message: #ARGUMENTS.Exception.rootcause.message#&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfelse&gt;</span></span>
		<span style="color: #333333;"><span style="color: #808080; background-color:#ffff80;">&lt;!--- dump error for Staging and Development ---&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfif</span> <span style="color: #800080;">len</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff">ARGUMENTS</span>.eventName<span style="color: #000000;">&#41;</span><span style="color: #800000;">&gt;</span></span>
			<span style="color: #333333;"><span style="color: #800000;">&lt;cfdump</span> <span style="color: #0000ff;">var</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#ARGUMENTS.eventName#&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;/cfif&gt;</span></span>
		<span style="color: #333333;"><span style="color: #800000;">&lt;cfdump</span> <span style="color: #0000ff;">var</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#ARGUMENTS.exception#&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;/cfif&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<h3>The onSessionStart Method</h3>
<p>Runs when your session starts.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onSessionStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>This method is used for initialising <code>SESSION</code>-scoped data, such as a shopping basket and application form.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onSessionStart&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #000099;"><span style="color: #800000;">&lt;cfscript&gt;</span></span>
<span style="color: #000099;">	SESSION.<span style="color: #0000ff;">start</span> <span style="color: #0000ff">=</span> <span style="color: #800080;">now</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	SESSION.strShoppingBasket <span style="color: #0000ff">=</span> <span style="color: #800080;">structNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</span>
<span style="color: #000099;">	SESSION.strShoppingBasket.items <span style="color: #0000ff">=</span> <span style="color: #ff0000;">0</span>;</span>
<span style="color: #000099;">	<span style="color: #800000;">&lt;/cfscript&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<h3>The onSessionEnd Method</h3>
<p>Runs when session ends</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cffunction</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;onSessionEnd&quot;</span> <span style="color: #0000ff">returnType</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;void&quot;</span> <span style="color: #0000ff">output</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;sessionScope&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;struct&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #800000;">&lt;cfargument</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;appScope&quot;</span> <span style="color: #0000ff;">type</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;struct&quot;</span> <span style="color: #0000ff">required</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #800000;">&lt;/cffunction&gt;</span></span></pre></div></div>

<p>Use this method for any clean-up activities when the session ends. A session ends when the session is inactive for the session time-out period. You can, for example, save session-related data, such as shopping basket contents or whether the user has not completed an order, in a database, or do any other required processing based on the user&#8217;s status. You might also want to log the end of the session, or other session related information, to a file for diagnostic use.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Adobe Livedocs has a whole <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/AppEvents_01.html" title="Application.CFC Reference" target="_blank" rel="nofollow">section dedicated to the Application.cfc</a>.</p>
<p>I have created an <a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/application.txt" title="Example Application.cfc Template - ColdFusion 8" target="_blank">example Application.cfc</a>, which is available for <a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2008/03/application.txt" title="Example Application.cfc Template - ColdFusion 8" target="_blank">download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/anatomy-of-the-applicationcfc-in-coldfusion-8/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Configuring ColdFusion 8 with Apache</title>
		<link>http://www.simonwhatley.co.uk/configuring-coldfusion-8-with-apache</link>
		<comments>http://www.simonwhatley.co.uk/configuring-coldfusion-8-with-apache#comments</comments>
		<pubDate>Fri, 16 Nov 2007 09:47:30 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache installation]]></category>
		<category><![CDATA[Application Servers]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[trouble shooting]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=334</guid>
		<description><![CDATA[After installing ColdFusion 8 and Apache successfully you may still see an "HTTP 500 Internal Server Error" when navigating to a ColdFusion page. All is not lost, you simply need to configure, or check the configuration of Apache. Apache requires very little post installation modification, but it is always good practice to check the httpd.conf file to ensure that the ColdFusion "install" scripts did what they were supposed to do.]]></description>
			<content:encoded><![CDATA[<p>After installing ColdFusion 8 and Apache successfully you may still see an &#8220;HTTP 500 Internal Server Error&#8221; when navigating to a ColdFusion page. All is not lost, you simply need to configure, or check the configuration of Apache.</p>
<p>Apache requires very little post installation modification, but it is always good practice to check the <em>httpd.conf</em> file to ensure that the ColdFusion &#8220;install&#8221; scripts did what they were supposed to do.</p>
<p>If you haven&#8217;t confirmed that Apache is running, open your browser and point it to <a href="http://localhost/">http://localhost/</a> (unless you specified a real URL during installation). You should see the Apache test page. If you see an error, review the <a href="http://www.simonwhatley.co.uk/installing-apache-on-vista" title="Apache Installation">Apache installation steps</a> to make sure you followed all the steps correctly, and/or check your log files for more detailed errors.</p>
<p>Now we know Apache is running, but how about ColdFusion? Point your browser to the ColdFusion Administrator  found commonly at <a href="http://localhost/CFIDE/administrator/index.cfm" title="The ColdFusion Administrator" target="_blank">http://localhost/CFIDE/administrator/index.cfm</a> and see what happens. One of three possible failures could occur:</p>
<ol>
<li>Your <strong>browser prompts you to save the .cfm</strong> file to your computer. There a couple of possible resolutions to this. Firstly restart the Apache service. If this does not resolve the issue you will need to check the <em>httpd.conf</em> file to ensure that the ColdFusion module is being loaded. The file can typically be found in the <em>C:\Program Files\Apache Software Foundation\Apache2.2\conf\</em> directory.<br />
Make sure that the <code>DirectoryIndex</code> has a reference to the <code>index.cfm</code> file (i.e. the default file):<img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2007/11/dir-module-cfm.png" alt="Apache dir_module Declaration" />Ensure that the <code>LoadModule jrun_module "C:/ColdFusion8/runtime/lib/wsconfig/1/mod_jrun22.so"</code> is also present:</p>
<p><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2007/11/jrun-settings.png" alt="Apache JRun Settings" /></p>
<p>If you need to edit this file, restart the Apache service after you have saved the changes.</li>
<li>You get a message that <strong>the CFIDE folder cannot be found</strong>. This is more likely to be a problem with where you placed the ColdFusion application during install. The default location is in the Apache directory (<em>C:\Program Files\Apache Software Foundation\Apache2.2\htdocs</em>), so check in the http.conf file to ensure the DocumentRoot is pointing correctly. Alternatively, copy this folder to your localhost webroot (e.g. <em>C:\WebRoot</em>) ensuring that the DocumentRoot points to your webroot (see the yellow box in the second screen-shot).</li>
<li>You get another message which probably means that you need to reinstall ColdFusion, and/or Apache!</li>
</ol>
<p>And that is it, you can start using ColdFusion and developing applications.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/configuring-coldfusion-8-with-apache/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Poor Man&#039;s HTTP Compression with ColdFusion</title>
		<link>http://www.simonwhatley.co.uk/poor-mans-http-compression-with-coldfusion</link>
		<comments>http://www.simonwhatley.co.uk/poor-mans-http-compression-with-coldfusion#comments</comments>
		<pubDate>Sat, 17 Mar 2007 15:11:23 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Application Servers]]></category>
		<category><![CDATA[Coldbeans]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTP protocol]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[Web Browser]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[WEB-INF folder]]></category>
		<category><![CDATA[WEB-INF/lib folder]]></category>
		<category><![CDATA[web.xml]]></category>
		<category><![CDATA[web.xml file]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=260</guid>
		<description><![CDATA[Almost every web application will benefit from the compression of content. A compression filter optimises the size of the content that is sent from a webserver to a web browser via the Internet. Since generating content and serving pages via the World Wide Web is the core behind web applications, it is simple components that aid these processes that are incredibly useful. This is where servlet filters come into play.]]></description>
			<content:encoded><![CDATA[<p>An interesting article I read in the CFDJ recently was entitled Poor Man&#8217;s HTTP Compression with ColdFusion. Almost every web application will benefit from the compression of content. A compression filter optimises the size of the content that is sent from a webserver to a web browser via the Internet. Since generating content and serving pages via the World Wide Web is the core behind web applications, it is simple components that aid these processes that are incredibly useful. This is where servlet filters come into play.</p>
<p>Servlet filters are tools available to web application developers. They are designed to be able to manipulate the request and responses that are sent to a web application, without manipulating the servlets, static pages like HTML and, in this case, CFM pages that are being used by the web application (unless of course that is the desired response). Servlet filters act like a chain of steps that a request and response must go through before reaching the page in the application.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Compressing Content Using a Servlet Filter</h3>
<p>Compression is a process that reduces the number of bytes required to define a document in order to save disk space or transmission time. It is extremely useful for sending information across the web, because the speed at which people receive information from a web application is dependent upon how much data you are trying to send. The smaller the amount of information that is to be sent, the faster it can be sent. Therefore, compression and the associated responsiveness is a key component to retaining users and generating revenue from those retained users.</p>
<p>Compression can be effectively achieved by having a servlet filter conditionally pipe the produced content to a GZip-compressed file. GZip is supported by the HTTP protocol and almost all modern browsers (hence the servlet filter conditionally compresses the content).</p>
<p>GZip compression usually results in a 6:1 compression ratio, although this depends on how much content is being sent and what the content is.</p>
<h3>Setting up the Servlet Filter in ColdFusion</h3>
<p>Using the ColdBeans servlet filter found at the following URL:</p>
<p><a href="http://www.servletsuite.com/servlets/gzipflt.htm" rel="nofollow">http://www.servletsuite.com/servlets/gzipflt.htm</a></p>
<ul>
<li>Download the <a href="http://www.servletsuite.com/servlets/gzipflt.jar" rel="nofollow">GZipFilter.jar</a></li>
<li>Save GZipFilter.jar in the WEB-INF/lib folder in the ColdFusion Server wwwroot.</li>
<li>Edit the web.xml file in the WEB-INF folder in the ColdFusion Server wwwroot with the following code:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;filter&gt;
&lt;filter-name&gt;GzipFilter&lt;/filter-name&gt;
&lt;filter-class&gt;com.cj.gzipflt.GzipFilter&lt;/filter-class&gt;
&lt;/filter&gt;
&lt;filter-mapping&gt;
&lt;filter-name&gt;GzipFilter&lt;/filter-name&gt;
&lt;url-pattern&gt;*.cfm&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;</pre></div></div>

</li>
<li>Restart the ColdFusion Service</li>
</ul>
<p>Now, when you invoke any <code>.cfm</code> page the GzipFilter will check out client&#8217;s browser settings. If the browser does not support gzip, the filter invokes resource normally. If the browser does support gzip, output will be compressed.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/poor-mans-http-compression-with-coldfusion/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

