<?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>The Thinking Lemur &#187; ColdFusion</title>
	<atom:link href="http://thinkinglemur.com/index.php/category/thinking/programming/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkinglemur.com</link>
	<description>from the mind of Donnie Bachan</description>
	<lastBuildDate>Fri, 06 Jan 2012 10:42:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Column formats in  CFSpreadsheet</title>
		<link>http://thinkinglemur.com/index.php/2011/05/column-formats-in-cfspreadsheet/</link>
		<comments>http://thinkinglemur.com/index.php/2011/05/column-formats-in-cfspreadsheet/#comments</comments>
		<pubDate>Fri, 06 May 2011 00:22:46 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=449</guid>
		<description><![CDATA[I really like the spreadsheet functions added to ColdFusion 9. It makes my life so much easier but I discovered an annoyance with the spreadsheetFormatColumn function today. It would seem that you have to set the column formats after you add data to a spreadsheet. If you attempt to set it before calling spreadsheetAddRows it [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2011%2F05%2Fcolumn-formats-in-cfspreadsheet%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2011%2F05%2Fcolumn-formats-in-cfspreadsheet%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I really like the spreadsheet functions added to ColdFusion 9. It makes my life so much easier but I discovered an annoyance with the spreadsheetFormatColumn function today. It would seem that you have to set the column formats after you add data to a spreadsheet. If you attempt to set it before calling spreadsheetAddRows it will set the column format to default. Not cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2011/05/column-formats-in-cfspreadsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Railo 3.2 + Tomcat + Mac Snow Leopard + Permission Denied</title>
		<link>http://thinkinglemur.com/index.php/2011/04/railo-3-2-tomcat-mac-snow-leopard-permission-denied/</link>
		<comments>http://thinkinglemur.com/index.php/2011/04/railo-3-2-tomcat-mac-snow-leopard-permission-denied/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 21:09:05 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=430</guid>
		<description><![CDATA[I've finally started playing with Railo and tried installing it on my Mac with Snow Leopard installed. I wasn't able to get it to run initially but had to make two quick changes to get it running: Give the current user (the user under which you are currently logged in) Read + Write access to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2011%2F04%2Frailo-3-2-tomcat-mac-snow-leopard-permission-denied%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2011%2F04%2Frailo-3-2-tomcat-mac-snow-leopard-permission-denied%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've finally started playing with Railo and tried installing it on my Mac with Snow Leopard installed. I wasn't able to get it to run initially but had to make two quick changes to get it running:</p>
<ol>
<li>Give the current user (the user under which you are currently logged in) Read + Write access to the entire<strong>*</strong> Railo folder, including all the sub folders.</li>
<li>Change the default port for Tomcat from port 80, to port 8080 since I already had Apache running on port 80. To change the port, edit /Railo/Tomcat/conf/server.xml and change the connector port.</li>
</ol>
<p>I have largely ignored Railo in the past but I am really eager to play around with it and get some stuff deployed on this platform.</p>
<p>* Note that I am using Railo in a development environment so I gave full Read + Write access to the <em><strong>entire</strong></em> Railo folder, in a production set up this would definitely not be a wise thing to do. I don't think this would be a problem in most development environments since the user under which Tomcat would be running would usually have the correct permissions.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2011/04/railo-3-2-tomcat-mac-snow-leopard-permission-denied/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE 7/8 PNG-24 transparency issue</title>
		<link>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/</link>
		<comments>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 11:12:47 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=384</guid>
		<description><![CDATA[We came across an error today with our drop down menu system that uses a PNG-24 semi transparent drop shadow image around the border where the transparency would appear black in IE 7 and IE 8. After searching and trying all possible fixes we found the solution to the problem and it was quite simple. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F06%2Fie-78-png-24-transparency-issue%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F06%2Fie-78-png-24-transparency-issue%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We came across an error today with our drop down menu system that uses a PNG-24 semi transparent drop shadow image around the border where the transparency would appear black in IE 7 and IE 8. After searching and trying all possible fixes we found the solution to the problem and it was quite simple.</p>
<p>Our menu system uses jQuery (doesn't everything these days?), and had a nice fade in and fade out transition. jQuery handles the fade transitions by setting the opacity which IE does not like very much. So using the fadeTo() functions in jQuery is a no-no in IE. The solution, use hide() and show() instead. It's not as elegant but the transparency issue was fixed on all modern browsers.</p>
<p>Other solutions to the problem include:</p>
<p>1. Using a background colour instead of transparent on the style so you would do:</p>
<blockquote><p>.my-transparent-stuff{background: #fff url('image.png') repeat-y scroll left top;}</p>
<p>instead of</p>
<p>.my-transparent-stuff{background: transparent url('image.png') repeat-y scroll left top;}</p></blockquote>
<p>2. Using PNG-8/transparent gifs (hey, it's a solution)</p>
<p>3. Forcing IE8 into IE7 mode by adding the following meta tag:</p>
<blockquote><p>&lt;meta http-equiv="X-UA-Compatible" content="IE=7" /&gt;</p></blockquote>
<p>I still can't understand what Microsoft is doing!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/06/ie-78-png-24-transparency-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Memory leaks with Coldfusion 8</title>
		<link>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 14:58:44 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[ColdFusion 8]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[memory leaks]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=368</guid>
		<description><![CDATA[For the past few weeks I've been incognito due to some memory leak issues we've been having with our new app. It is essentially a rewrite of our existing web application using Object Oriented techniques and embraces the Model-View-Controller paradigm. It really is a pretty little thing but unfortunately she crumbled under the weight of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F02%2Fmemory-leaks-with-coldfusion-8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F02%2Fmemory-leaks-with-coldfusion-8%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For the past few weeks I've been incognito due to some memory leak issues we've been having with our new app. It is essentially a rewrite of our existing web application using Object Oriented techniques and embraces the Model-View-Controller paradigm. It really is a pretty little thing but unfortunately she crumbled under the weight of the world wide web. Anyone who has faced the memory leak problem will know that it is not an easy one to crack and it takes time to determine the exact issue. There are a lot of articles around that have excellent information which were all very helpful in my quest for a solution.</p>
<p>The system made a lot of use of the session and application scope for caching objects which was the first issue that we had to overcome. It seemed like a good idea, you've got loads of memory, you have a finite amount of objects that can be called for each session why not persist them. The problem is that ColdFusion 8 seems to have an issue with complex objects (i.e. CFCs) stored in the session and application scopes. The reason I say this is that we were seeing a very, very strange thing happening to the memory on our server. When load testing was run, the server was fine, the memory steadily increased until the initial sessions began expiring and then the average of memory usage plateaued, which is what you like to see. However, once the load test ended the memory steadily increased until it crashed the CF instance. Weird right? And so the search for a solution began. I came across a few helpful articles:</p>
<p><a href="http://www.ghidinelli.com/2009/07/16/finding-memory-leaks-coldfusion-jvm">http://www.ghidinelli.com/2009/07/16/finding-memory-leaks-coldfusion-jvm</a></p>
<p><a href="http://www.schierberl.com/cfblog/index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler">http://www.schierberl.com/cfblog/index.cfm/2006/10/12/ColdFusion_memoryLeak_profiler</a></p>
<p><a href="http://www.alagad.com/blog/post.cfm/troubleshooting-coldfusion-performance-analysis-part-ii">http://www.alagad.com/blog/post.cfm/troubleshooting-coldfusion-performance-analysis-part-ii</a></p>
<p>These were tremendously helpful in assisting me in finding the solution. The last post from Alagad was the one that helped cure my issue in the end. You need to ensure that when making copies of persistent scoped variables that they are deep copied or used in a local scope within CFC functions. However, bear in mind that there are many causes for memory leaks and you should spend the time in figuring out the exact cause of your problem. I found the <a href="http://www.eclipse.org/mat/" target="_blank">MAT</a> tool supremely useful.</p>
<p>Here are some tips for curing memory issues:</p>
<ol>
<li>Install cumulative hotfix 4 for ColdFusion 8.0.1 (Get it <a href="http://kb2.adobe.com/cps/529/cpsid_52915.html" target="_blank">here</a>)</li>
<li>Update the JVM to the latest provided by Sun, in my case it was JDK 1.6.0_18 (Get it <a href="http://java.sun.com/javase/downloads/index.jsp" target="_self">here</a>)</li>
<li>Add the -XX:+<em>AggressiveHeap</em> option to the JVM configuration (Read about it <a href="http://www.petefreitag.com/item/139.cfm" target="_blank">here</a>)</li>
<li>Set your min and max heap to the same size to reduce the number of garbage collection calls</li>
<li>Run varscoper against your code and ensure all local variables are var scoped (Get it <a href="http://varscoper.riaforge.org/" target="_blank">here</a>)</li>
<li>Limit the use of variables scope within objects, use the THIS reference instead</li>
<li>Limit the number of complex objects (cfcs) being stored in SESSION and APPLICATION scopes</li>
<li>Clear the variables scope onRequestEnd (this doesn't really work when using Application.cfc though)</li>
<li>Run load tests! We used WCAT for Windows (Get it <a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;i=1466&amp;g=6" target="_blank">here</a>)</li>
<li>Turn off CF monitoring use FusionReactor (or something similar) (Get FusionReactor <a href="http://www.fusion-reactor.com/" target="_blank">here</a>)</li>
</ol>
<p>Hopefully these will help someone else going forward.</p>
<p>UPDATE 16/05/2010: Point #6 should be, ensure you scope your variables correctly. The THIS scope has its own set of limitations. Ensure that all variables (including loop indices) have the proper scope to avoid leakage.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/02/memory-leaks-with-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON format and serializing ColdFusion query objects</title>
		<link>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/</link>
		<comments>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 20:25:52 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=343</guid>
		<description><![CDATA[Every so often there is a tiny problem that has you scratching your head until you RTFM. I love JSON, it's totally awesome and the fact that you can not convert CF objects natively is even better! I ran into a small issue where I was using serializeJSON on a structure that contained a query [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F01%2Fjson-serialize-coldfusion-quer%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2010%2F01%2Fjson-serialize-coldfusion-quer%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Every so often there is a tiny problem that has you scratching your head until you RTFM. I love <a href="http://bit.ly/wRcjs" target="_blank">JSON</a>, it's totally awesome and the fact that you can not convert CF objects natively is even better! I ran into a small issue where I was using serializeJSON on a structure that contained a query object (don't ask!). The problem was when the serialized string was deserialized using deserializeJSON the query was no longer a query, it was not a structure!  It turns out that the serializeJSON function takes <strong>two</strong> parameters!</p>
<pre class="cfm"><span style="color: #0000FF;">#SerializeJSON<span style="color: #0000FF;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span><span style="color: #0000FF;">&#91;</span>, serializeQueryByColumns<span style="color: #0000FF;">&#93;</span><span style="color: #0000FF;">&#41;</span>#</span></pre>
<p>The second optional parameter <em>serializeQueryByColumns </em>tells CF to handle queries in a special way. Now the trick is to remember to use the <strong>second</strong> parameter of the DeserializeJSON function which performs the reverse operation. The second parameter must be set to <strong>false</strong> for the query object to be recreated during deserialization.</p>
<p>Here are links to the <a href="http://bit.ly/8IYMN5" target="_blank">serializeJSON</a> and <a href="http://bit.ly/8IYMN5" target="_blank">deserializeJSON</a> in LiveDocs.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2010/01/json-serialize-coldfusion-quer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s been a while</title>
		<link>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/</link>
		<comments>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 10:11:48 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=243</guid>
		<description><![CDATA[I've not posted anything on my blog for a while, it always amazes me how the top bloggers in the ColdFusion world find the time to post almost daily about tips, tricks, resources and I hardly every find the time to write a note to myself. My posts don't seem as interesting or as insightful [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F12%2Fits-been-a-while%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F12%2Fits-been-a-while%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've not posted anything on my blog for a while, it always amazes me how the top bloggers in the ColdFusion world find the time to post almost daily about tips, tricks, resources and I hardly every find the time to write a note to myself. My posts don't seem as interesting or as insightful as some of the ones posted by the CF elite. I do thank them for their great posts and continued support of the ColdFusion community.</p>
<p>I've been working on a website recently that has soaked up all of my time. I've been having some problems with memory leaks and JVM tuning but I think I've finally found solutions to my problems and will be posting them in a separate article shortly which will hopefully help someone out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/12/its-been-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix/Int (Floor) function oddity in ColdFusion 8</title>
		<link>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 14:10:51 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ColdFusion 8]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=238</guid>
		<description><![CDATA[I've discovered an odd little "bug" in the Fix and Int functions in ColdFusion 8. The Fix/Int functions work similarly to the Floor function in other languages: According to the ColdFusion 8 LiveDocs Int - Calculates the closest integer that is smaller than number. For example, it returns 3 for Int(3.3) and for Int(3.7); it returns [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F07%2Ffixint-floor-function-oddity-in-coldfusion-8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F07%2Ffixint-floor-function-oddity-in-coldfusion-8%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I've discovered an odd little "bug" in the Fix and Int functions in ColdFusion 8. The Fix/Int functions work similarly to the Floor function in other languages:</p>
<p>According to the ColdFusion 8 LiveDocs</p>
<p>Int - Calculates the closest integer that is smaller than number. For example, it returns 3 for Int(3.3) and for Int(3.7); it returns -4 for Int(-3.3) and for Int(-3.7)</p>
<p>Fix - Converts a real number to an integer. If number is greater than or equal to 0, the closest integer less than or equal to number. If number is less than 0, the closest integer greater than or equal to number.</p>
<p>Now, if you do #Fix(15)# or #Int(15)# the functions return the correct value of 15. However if you do #Fix((6.84/45.60) * 100)# or #Int((6.84/45.60) * 100)# the functions return 14 which is incorrect since the equation equates to 15.</p>
<p>Bug or Feature?</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/07/fixint-floor-function-oddity-in-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CFPOP and SSL</title>
		<link>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/</link>
		<comments>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 11:05:40 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CFPOP]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=220</guid>
		<description><![CDATA[One of the reasons I love Adobe's ColdFusion so much is the fact that it is built on a Java engine and you are able to use a lot of the powerful features of Java from CF. I however don't get to use this feature often enough, mainly because most of the things I work [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F04%2Fcfpop-and-ssl%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F04%2Fcfpop-and-ssl%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the reasons I love Adobe's ColdFusion so much is the fact that it is built on a Java engine and you are able to use a lot of the powerful features of Java from CF. I however don't get to use this feature often enough, mainly because most of the things I work on daily doesn't really need anything other than what is provided by the CF natively. And, well, as with anything without practice your skills get dull, so when I had to access a mailbox that is hosted by Gmail using CFPOP I was forced to turn to Google to find a solution.</p>
<p>CFPOP does not support SSL/TLS connections as of version 8, which is quite a big limitation since so many services now support SSL for POP connections. There are quite a few options for work arounds for this but the simplest and quite elegant solution is the one provided by <a href="http://www.anujgakhar.com/2008/05/18/cfpop-and-gmail/">Anuj Gakhar</a>. This solution uses the underlying Java pop service which does support SSL.</p>
<blockquote><p> </p>
<p>&lt;cfset javaSystem = createObject("java", "java.lang.System") /&gt;</p>
<p>&lt;cfset jProps = javaSystem.getProperties() /&gt;</p>
<p> </p>
<p>&lt;cfset jProps.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory") /&gt;</p>
<p><span> </span>&lt;cfset jProps.setproperty("mail.pop3.port", variables.popPort) /&gt;</p>
<p><span> </span>&lt;cfset jProps.setProperty("mail.pop3.socketFactory.port", variables.popPort) /&gt;</p>
<p> </p>
<p> </p></blockquote>
<p>Set variables.popPort to the port on which your POP server is accessed. You then call the CFPOP tag as you would normally:</p>
<blockquote><p>&lt;cfpop action="getHeaderOnly"</p>
<p>            server="#variables.popServer#"</p>
<p>            port="#variables.popPort#"</p>
<p>            username="#variables.popUsername#"</p>
<p>            password="#variables.popPassword#"</p>
<p>            maxrows="5"</p>
<p>            timeout="60"</p>
<p>            name="variables.popRecords" /&gt;</p></blockquote>
<p>The underlying Java platform can allow you to perform many tasks that may not be available in ColdFusion, so why not do some experiments?</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/04/cfpop-and-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayPal Annoyances</title>
		<link>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/</link>
		<comments>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 09:58:18 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Paypal]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=195</guid>
		<description><![CDATA[This is a trivial post but Paypal integration has been a headache over the past few years which the manuals having incorrect information, differences between the UK and US apis and hugely unhelpful error codes. Things have gotten a bit better in recent times but still not as good as it should be given the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F03%2Fpaypal-annoyances%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F03%2Fpaypal-annoyances%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This is a trivial post but Paypal integration has been a headache over the past few years which the manuals having incorrect information, differences between the UK and US apis and hugely unhelpful error codes. Things have gotten a bit better in recent times but still not as good as it should be given the proliferation of Paypal integration. We recently had a little issue that had me banging my head against my keyboard. Now this <strong>IS</strong> in the api specification but I think this is a bit absurd.</p>
<p>Apparently, you need to specify the amount as a decimal number to two decimal places otherwise the amount is flagged as invalid. So you must give your amount value as xx.xx and not xx.xxx or any other number of decimal places. You will receive an INVALID AMOUNT error and the transaction history in Paypal Manager will show INVALID AMOUNT $0.00 USD, even if you are using another currency.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/03/paypal-annoyances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting secure attribute of JSESSIONID cookie in ColdFusion 8</title>
		<link>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/</link>
		<comments>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 10:57:55 +0000</pubDate>
		<dc:creator>Donnie Bachan</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[PCI]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://thinkinglemur.com/?p=177</guid>
		<description><![CDATA[As part of PCI compliance our servers were run through third party security auditing and one warning we received was "Missing Secure Attribute in an Encrypted Session (SSL) Cookie". This warning referred to the JSESSIONID cookie being set in our SSL enabled pages not having the SECURE attribute set. In ColdFusion there is no way [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fsetting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthinkinglemur.com%2Findex.php%2F2009%2F02%2Fsetting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8%2F&amp;source=thinkinglemur&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As part of PCI compliance our servers were run through third party security auditing and one warning we received was "Missing Secure Attribute in an Encrypted Session (SSL) Cookie". This warning referred to the JSESSIONID cookie being set in our SSL enabled pages not having the SECURE attribute set. In ColdFusion there is no way for you to do this programatically (since you would not explicitly create the JSESSIONID cookie) or even via the administrator. After a lot of searching and reading I found the solution thanks to comment on this post:</p>
<p><a href="http://www.bennadel.com/blog/785-Ask-Ben-Hiding-Encrypting-ColdFusion-CFID-And-CFTOKEN-Values.htm">http://www.bennadel.com/blog/785-Ask-Ben-Hiding-Encrypting-ColdFusion-CFID-And-CFTOKEN-Values.htm</a></p>
<p>The solution is quite simple, add:</p>
<blockquote><p>&lt;cookie-config&gt;<br />
&lt;cookie-secure&gt;true&lt;/cookie-secure&gt;<br />
&lt;/cookie-config&gt;</p></blockquote>
<p>after the &lt;/persistence-config&gt; element in your jrun-web.xml file which is usually located in C:\JRun4\servers\yourservername\cfusion-ear\cfusion-war\WEB-INF\jrun-web.xml. If you are running in multiserver mode of CF Enterprise and have multiple application instances, you must add this to the jrun-web.xml of every application instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkinglemur.com/index.php/2009/02/setting-secure-attribute-of-jsessionid-cookie-in-coldfusion-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

