<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>The blog of Russ (snake) Michaels - Ajax</title>
			<link>http://russ.michaels.me.uk/index.cfm</link>
			<description>This is the blog of Russ Michaels. Here you will find lots of stuff about ColdFusion, tech support and hosting, but the occasional random ramblings about motorcycles, tattoos, the state of the world, rogue traders, product reviews and other stuff that makes me rant.</description>
			<language>en-gb</language>
			<pubDate>Wed, 08 Sep 2010 02:52:22 --0100</pubDate>
			<lastBuildDate>Wed, 10 Jun 2009 12:34:00 --0100</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>russ@michaels.me.uk</managingEditor>
			<webMaster>russ@michaels.me.uk</webMaster>
			
			<item>
				<title>CFAjaxProxy Security errors</title>
				<link>http://russ.michaels.me.uk/index.cfm/2009/6/10/CFAjaxProxy-Security-errors</link>
				<description>
				
				&lt;p&gt;This was a very odd problem I had on a clients site this week. Whenever he used the &amp;lt;CFAjaxProxy&amp;gt; tag on a page, the page simply stopped rendering at the point where the tag appeared. No error appeared on the page or in the ColdFusion logs.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;The reason no error occurred turned out to be caused by the application.cfc, he has an OnError function that was doing a cfabort.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;cffunction&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;onError&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;returnType&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;void&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;cfargument&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;exception&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;cfargument&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;eventname&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;string&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;rem&quot;&gt;&amp;lt;!--- &amp;lt;cfdump var=&amp;quot;#ARGUMENTS#&amp;quot; /&amp;gt; ---&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;cfabort&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;cffunction&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p&gt;Once I got rid of this problem, the following error appeared.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;p style=&quot;width: 95%; height: 108px&quot; class=&quot;code&quot;&gt;Security: The requested template has been denied access to C:\ColdFusion8\wwwroot\WEB-INF\cfclasses\cfcheckUsername2ecfc1070071758.class.   &lt;br /&gt;The following is the internal exception message: access denied (java.io.FilePermission C:\ColdFusion8\wwwroot\WEB-INF\cfclasses\cfcheckUsername2ecfc1070071758.class write)&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;So yet another path that needs to be added to the sandbox for every site in order for Ajax to work. Really there is no reason why this should be so as the classes should be created by CF internally and no special permissions should be required by the application. &lt;/p&gt;  &lt;p&gt;The number of paths now required in each sandbox for CF8 in order for all tags and functions to work correctly is ridiculous. I have enlightened Adobe how things should work in shared hosting environments and all the paths that do not get inherited by sandboxes when applied at a root level, so here&amp;#39;s hoping that CF9 will finally be shared hosting friendly.&lt;/p&gt;  &lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;  .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, &quot;Courier New&quot;, courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Ajax</category>				
				
				<pubDate>Wed, 10 Jun 2009 12:34:00 --0100</pubDate>
				<guid>http://russ.michaels.me.uk/index.cfm/2009/6/10/CFAjaxProxy-Security-errors</guid>
				
			</item>
			
			<item>
				<title>CF8: Security issue with new AJAX functions</title>
				<link>http://russ.michaels.me.uk/index.cfm/2007/11/1/CF8-Security-issue-with-new-AJAX-functions</link>
				<description>
				
				&lt;p&gt;I recently had the following error reported by a cfdeveloper member since upgrading to ColdFusion 8.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;code&quot;&gt;Security: The requested template has been denied access to&lt;br /&gt;C:\Inetpub\wwwroot\CFIDE\scripts\ajax\messages\cfmessage_en_GB_.js.&lt;br /&gt;The following is the internal exception message: access denied&lt;br /&gt;(java.io.FilePermission&lt;br /&gt;C:\Inetpub\wwwroot\CFIDE\scripts\ajax\messages\cfmessage_en_GB_.js read)&lt;br /&gt;&lt;br /&gt;ColdFusion cannot determine the line of the template that caused this error.&lt;br /&gt;This is often caused by an error in the exception handling subsystem.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now the security error is partly to be expected as I use security sandboxes and this path is thus not allowed by default, but the unexpected thing is the path it is trying to use in the first place.&lt;/p&gt;&lt;p&gt;Now like any good host should, I do not use the default CFIDE folder as I do not want every web site to have access to the ColdFusion Administrator, so the path to my CFIDE folder is actually D:\wwwroot\CFIDE and this is where the virtual directory points to for each web site. As you can see ColdFusion 8 completely ignores this fact and is using the default C:\Inetpub\wwwroot\CFIDE instead, which seems like a bug to me.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So if you are running in a sandboxed or shared hosting environment then you need to consider this fact and will need to add the above path to your default sandbox or ask your host to do so.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>Ajax</category>				
				
				<pubDate>Thu, 01 Nov 2007 00:36:00 --0100</pubDate>
				<guid>http://russ.michaels.me.uk/index.cfm/2007/11/1/CF8-Security-issue-with-new-AJAX-functions</guid>
				
			</item>
			
			<item>
				<title>new DWRUtil javascript functions</title>
				<link>http://russ.michaels.me.uk/index.cfm/2007/8/23/new-DWRUtil-javascript-functions</link>
				<description>
				
				&lt;p&gt;I use AjaxCFC currently and have written a few custom JS functions for the DWRUtil.js library. I thought I would share these in case they are useful to anyone else. I found that I needed to these particular tasks quite a lot.&lt;/p&gt;&lt;p&gt;Just drop these into the util.js file&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;selectPop()&lt;br /&gt;Populate a select list with an object of arrays returned by AjaxCFC&lt;/li&gt;&lt;li&gt;selectOption()&lt;br /&gt;looks for a specific option value in a select list, if it is there, sets it to SELECTED&lt;/li&gt;&lt;li&gt;getSelected()&lt;br /&gt;get the currently selected item in a SELECT list. if multiple options selected, return as an array&lt;/li&gt;&lt;li&gt;getSelectedText()&lt;br /&gt;As above but gets the text of selected options&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;code&quot;&gt;&lt;p&gt;/* DWRUtil.selectPop &lt;br /&gt;added by Russ Michaels&lt;br /&gt;Populate a select list with an object of arrays returned by AjaxCFC&lt;br /&gt;e.g.&lt;br /&gt;r.id[0] = 1&lt;br /&gt;r.name[0] = &amp;#39;Russ&amp;#39;&lt;/p&gt;&lt;p&gt;arguments:-&lt;br /&gt;list&amp;nbsp;&amp;nbsp;:&amp;nbsp;name of select list to populate&lt;br /&gt;obj&amp;nbsp;&amp;nbsp;&amp;nbsp;:&amp;nbsp;object containing array&lt;br /&gt;text&amp;nbsp;&amp;nbsp;:&amp;nbsp;item to be used for option text&lt;br /&gt;value&amp;nbsp;&amp;nbsp;:&amp;nbsp;item to be used for option value&lt;br /&gt;defaultTop&amp;nbsp;:&amp;nbsp;default value to be inserted at top of list&lt;br /&gt;overwrite&amp;nbsp;:&amp;nbsp;boolean, whetehr or not to overwrite existing list&lt;br /&gt;Synjtax:-&lt;br /&gt;DWRUtil.selectPop(&amp;#39;customers&amp;#39;, r, &amp;#39;id&amp;#39;,&amp;#39;name&amp;#39;,[&amp;#39;select one&amp;#39;], [true])&lt;br /&gt;*/&lt;br /&gt;DWRUtil.selectPop = function(list, obj, text, value, defaultTop, overwrite) {&lt;br /&gt;&amp;nbsp;if(overwrite) $(list).options.length = 0;&lt;br /&gt;&amp;nbsp;//insert a default top item in the list such as **please select**, its value will be 0&lt;br /&gt;&amp;nbsp;if(defaultTop)&lt;br /&gt;&amp;nbsp;&amp;nbsp;$(list).options[0] = new Option(defaultTop, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;for(x=0;x&amp;lt;obj[text].length;x++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(list).options[$(list).options.length] = new Option(obj[text][x], obj[value][x]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;};&lt;/p&gt;&lt;p&gt;selectOption = function (list,searchstr)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;//looks for a specific option value in a select list, if it is there, sets it to SELECTED&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;for(a=0;a&amp;lt;list.length;a++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;if(list.options[a].value == searchstr)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.options[a].selected = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;getSelected = function (ele)&lt;br /&gt;{&lt;/p&gt;&lt;p&gt;//get the currently selected item in a SELECT list. if multiple options selected, return as an array&lt;br /&gt;&amp;nbsp;element = $(ele);&lt;br /&gt;&amp;nbsp;selectedArray = new Array();&lt;br /&gt;&amp;nbsp;for(x=0;x&amp;lt;element.options.length;x++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(element.options[x].selected)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;selectedArray[selectedArray.length] = element.options[x].value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;if(selectedArray.length == 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;return selectedArray[0];&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;return selectedArray;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;getSelectedText = function (ele)&lt;br /&gt;{&lt;/p&gt;&lt;p&gt;//gets the text of selected options&lt;br /&gt;&amp;nbsp;element = $(ele);&lt;br /&gt;&amp;nbsp;selectedArray = new Array();&lt;br /&gt;&amp;nbsp;for(x=0;x&amp;lt;element.options.length;x++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(element.options[x].selected)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;selectedArray[selectedArray.length] = element.options[x].text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;if(selectedArray.length == 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;return selectedArray[0];&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;return selectedArray;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt; 
				</description>
				
				<category>Ajax</category>				
				
				<pubDate>Thu, 23 Aug 2007 18:04:00 --0100</pubDate>
				<guid>http://russ.michaels.me.uk/index.cfm/2007/8/23/new-DWRUtil-javascript-functions</guid>
				
			</item>
			</channel></rss>