<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
			<channel>
			<title>Charlie Arehart&apos;s Blog - carehart classics</title>
			<link>http://www.carehart.org/blog/client/index.cfm</link>
			<atom:link href="http://www.carehart.org/blog/client/rss.cfm" rel="self" type="application/rss+xml" />
			<description>Charlie Arehart&apos;s Blog</description>
			<language>en-us</language>
			<lastBuildDate>Fri, 03 Aug 2007 11:46:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>blogmaster@carehart.org (Charlie Arehart)</managingEditor>
			<webMaster>blogmaster@carehart.org (Charlie Arehart)</webMaster>
			
			<item>
				<title>Testing code in CF8 and earlier releases--in the same code directory</title>
				<link>http://www.carehart.org/blog/client/index.cfm/2007/8/3/testing_code_in_multiple_releases</link>
				<description>
				
				As folks contemplate moving to CF8 from 6 or 7, they may know that they can run these releases alongside each other--as long as you use a separate web server (or web site in servers that support it) configured to hand CFML requests to each CF server. Since CF6, CF has included a built-in web server to help with this very issue, especially on servers (like IIS on XP) where you can&apos;t have more than one site.

But what if you want to test some code in a single directory against one or more editions? Is that possible? I mean, let&apos;s say you have CF7 setup against IIS, and your code is in the c:\inetpub\wwwroot? And you&apos;ve installed CF 8 for testing using its built-in web server, which runs on port 8500 (or whatever you chose) and finds its code in, for instance, c:\coldfusion8\wwwroot. 

How would you have CF8 look at the code you&apos;ve long had running in the IIS root? (or Apache, or a virtual directory you&apos;ve setup for use by either external web server). Do you have to move the code around among these directories to test it on different versions of CF? No, you don&apos;t.

The trick is in the jrun-web.xml, which you can find in cfusionmx_home]\wwwroot\WEB-INF\jrun-web.xml . You can add a new &quot;virtual-mapping&quot; entry there, naming a new &quot;alias&quot; which points to files outside the normal CF-based wwwroot:

&lt;code&gt;
&lt;virtual-mapping&gt; 
&lt;resource-path&gt;/inet/*&lt;/resource-path&gt; 
&lt;system-path&gt;C:/inetpub/wwwroot/&lt;/system-path&gt; 
&lt;/virtual-mapping&gt; 
&lt;/code&gt;

So now a request for http://localhost:8500/inet/ will look instead in the inetpub/wwwroot, or wherever you point it.

Update: Note that when you use the resource-path, &lt;u&gt;it&apos;s case-sensitive&lt;/u&gt;, even on Windows, so http://localhost:8500/INET/ would not be the same.

Of course, this works also if you set up CF8 to run via your built-in web server, but setup CF 7 or 6 to run on its own built-in web server. And of course, if you&apos;re savvy enough you may figure out how to run things so that you can run all 3 using an external web server. 

There are a couple of potential challenges with this technique. For one thing, if your code has hard-coded references (such as hyperlinks, images, CFLOCATIONS, etc.) to either run on a particular host (without the port) or at a particular root-relative path, then this introduction of a new port or the /inet/ alias may hamper it working. That&apos;s not a &quot;CF&quot; problem but rather a coding one. Your stuck then.

But it certainly works well for testing individual files. I do it all the time and have for years. Indeed, I&apos;ll share, for the sake of posterity, that this modifying of the jrun-web.xml is something I &lt;a href=&quot;http://cfmxplus.blogspot.com/2002/08/running-cfmx-code-outside-default.html&quot;&gt;first wrote about&lt;/a&gt; back in 2002, but many may have missed when such info was being shared. 

I&apos;m going to go back and reprise a lot of those &quot;oldies but goodies&quot;, spread across a few different blogs I&apos;ve had over the past several years. I think I&apos;ll call them &quot;carehart classics&quot;. 
				</description>
				
				<category>carehart classics</category>
				
				<category>cf8</category>
				
				<category>admin</category>
				
				<pubDate>Fri, 03 Aug 2007 11:46:00 -0400</pubDate>
				<guid>http://www.carehart.org/blog/client/index.cfm/2007/8/3/testing_code_in_multiple_releases</guid>
				
			</item>
			</channel></rss>