QUOTE (reportingsjr @ May 10 2007, 03:13 PM)

So... coldfusion is just shorthand code for java?
Although overly simplistic, I'd say thats an accurate statement.
QUOTE (jesh @ May 10 2007, 03:22 PM)

I didn't know that CF converted to Java at runtime either. Without having seen very much CF source code (How come there isn't a tutorial here?), I had assumed that the ML in CFML meant "Markup Language" and that pretty much everything you do with CF is through markup code. My biggest gripe, based on my assumption, was that there'd be no practical way to separate the presentation layer from the more complicated functional layers.
I understand now, I believe, that it is possible to separate those layers using Java. Without actually using Java, however, is it possible to separate out those two aspects of web development through CF alone?
I think I understand your question, so let me know if looking at this code helps. This code is all the source code that generates my
News Page on iribbit.net:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iribbit.net - Leap into the online experience! - COLD FUSION NEWS</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--- define news sources --->
<cfset cfdj_feed="http://cfdj.sys-con.com/index.rss">
<cfset forta_feed="http://www.forta.com/blog/rss.cfm?mode=full">
<cfset bryant_feed="http://steve.coldfusionjournal.com/index.rss">
<cfset cfnews_feed="http://www.fusionauthority.com/rss.cfm">
<cfset easycfmnews_feed="http://www.easycfm.com/syndication/EasyCFMNews.cfm">
<cfset easycfm_feed="http://www.easycfm.com/syndication/EasyFeed.xml">
<cfset digg_feed="http://www.digg.com/rss/index.xml">
<cfset npr_feed="http://www.npr.org/rss/rss.php?id=1019">
<cfset bbc_feed="http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/business/e-commerce/rss.xml">
<cfset cnn_feed="http://rss.cnn.com/rss/cnn_tech.rss">
<cfset wired_feed="http://www.wired.com/news/feeds/rss2/0,2610,3,00.xml">
<cfset cnet_feed="http://news.com.com/2547-1_3-0-5.xml">
<cfset zdnet_feed="http://news.zdnet.com/2509-9588_22-0-10.xml">
<!--- where feed is coming from --->
<cfparam name="newssource" default="Cold Fusion Developer's Journal">
<cfparam name="url.pullnewsfrom" default="cfdj_feed">
<cfif url.pullnewsfrom IS "bbc">
<cfset newssource = "BBC">
<cfset URLToPull = "#bbc_feed#">
<cfelseif url.pullnewsfrom IS "cnn">
<cfset newssource = "CNN">
<cfset URLToPull = "#bbc_feed#">
<cfelseif url.pullnewsfrom IS "wired">
<cfset newssource = "Wired News">
<cfset URLToPull = "#wired_feed#">
<cfelseif url.pullnewsfrom IS "cnet">
<cfset newssource = "c|net">
<cfset URLToPull = "#cnet_feed#">
<cfelseif url.pullnewsfrom IS "zdnet">
<cfset newssource = "ZDNet">
<cfset URLToPull = "#zdnet_feed#">
<cfelseif url.pullnewsfrom IS "npr">
<cfset newssource = "NPR">
<cfset URLToPull = "#npr_feed#">
<cfelseif url.pullnewsfrom IS "digg">
<cfset newssource = "digg.com">
<cfset URLToPull = "#digg_feed#">
<cfelseif url.pullnewsfrom IS "easycfm">
<cfset newssource = "EasyCFM Tutorials">
<cfset URLToPull = "#easycfm_feed#">
<cfelseif url.pullnewsfrom IS "easycfmnews">
<cfset newssource = "EasyCFM News">
<cfset URLToPull = "#easycfmnews_feed#">
<cfelseif url.pullnewsfrom IS "cfnews">
<cfset newssource = "Fusion Authority">
<cfset URLToPull = "#cfnews_feed#">
<cfelseif url.pullnewsfrom IS "bryant">
<cfset newssource = "Steve Bryant's Blog">
<cfset URLToPull = "#bryant_feed#">
<cfelseif url.pullnewsfrom IS "forta">
<cfset newssource = "Ben Forta's Blog">
<cfset URLToPull = "#forta_feed#">
<cfelse>
<cfset newssource = "Cold Fusion Developers Journal">
<cfset URLToPull = "#cfdj_feed#">
</cfif>
<cfoutput>
<link rel="alternate" type="application/rss+xml" href="#URLToPull#" title="RSS Feed Provided by: #ucase(url.pullnewsfrom)#" />
<link rel="shortcut icon" href="_images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="_includes/globalstylesheet.css" />
</cfoutput>
</head>
<body>
<cfinclude template="/i/_includes/makepovertyhistory.cfm">
<table width="780" cellpadding="0" cellspacing="0" border="0">
<tr><td width="288" valign="top" class="leftside">
<cfinclude template="/i/_includes/header.cfm">
<cfinclude template="/i/_includes/news.cfm">
</td><td width="492" valign="top" class="rightside">
<img src="_images/header-coldfusion.gif" alt="Macromedia - Cold Fusion Programming" width="492" height="107" hspace="0" vspace="0" border="0" /><br />
<cfinclude template="/i/_includes/navigation.cfm">
<img src="_images/pixel-white.gif" alt="white horizontal rule" width="492" height="1" hspace="0" vspace="0" border="0" /><br />
<div class="content">
<h1>Cold Fusion News :.<br /></h1>
To bring a little life to my site, I've pulled a couple <a href="rss.cfm" title="What is RSS?" accesskey="r"><img src="_images/btn-rss.gif" alt="What is RSS" width="36" height="14" hspace="3" vspace="0" border="0" /></a> Feeds into this page. You can currently choose between the technology related news stories from the following news sources:<br />
<br />
<ul>
<li><a href="news.cfm?pullnewsfrom=cfdj" title="Cold Fusion Developer's Journal" class="LinkButton">Cold Fusion Developer's Journal</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=forta" title="Ben Forta's Blog" class="LinkButton">Ben Forta's Blog</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=bryant" title="Steve Bryant's Blog" class="LinkButton">Steve Bryant's Blog</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=cfnews" title="Fusion Authority" class="LinkButton">Fusion Authority</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=easycfmnews" title="EasyCFM Mews" class="LinkButton">EasyCFM News</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=easycfm" title="EasyCFM Tutorials" class="LinkButton">EasyCFM Tutorials</a><br /></li>
<!--
<li><a href="news.cfm?pullnewsfrom=digg" title="digg.com" class="LinkButton">digg.com</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=npr" title="NPR" class="LinkButton">National Public Radio(NPR)</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=bbc" title="BBC" class="LinkButton">British Broadcasting Corporation(BBC)</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=wired" title="Wired News" class="LinkButton">Wired News</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=cnet" title="c|net" class="LinkButton">c|net</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=zdnet" title="ZDNet" class="LinkButton">ZDNet</a><br /></li>
<li><a href="news.cfm?pullnewsfrom=cnn" title="CNN" class="LinkButton">CNN</a><br /></li>
-->
</ul>
<br />
<cfoutput>
You are currently viewing and RSS Feed from <strong>#newssource#</strong>.<br />
</cfoutput>
<br /><hr /><br />
<cftry>
<!--- get feed from site --->
<cfhttp url="#URLToPull#" method="GET" timeout="15" />
<!--- parse xml information --->
<cfset objRSS = xmlParse(cfhttp.filecontent)>
<!---
<cfdump var="#objRSS#" label="NPR Top Stories RSS Feed">
<cfabort>
--->
<!--- find length of arrary to look through --->
<cfset ArrayLength = arraylen(objRSS.rss.channel.item)>
<cfset ItemsDisplayed = 0>
<!--- loop through array to output feed --->
<cfloop index="x" from="1" to="#ArrayLength#">
<cfoutput>
<cfset ItemsDisplayed = ItemsDisplayed + 1>
<strong>#objRSS.rss.channel.item[x].title.xmltext#</strong><br />
#objRSS.rss.channel.item[x].description.xmltext#<br />
<em class="smallfont">(#objRSS.rss.channel.item[x].pubdate.xmltext#)</em><br />
<a href="#replace(objRSS.rss.channel.item[x].link.xmltext,'&','&','all')#" title="#objRSS.rss.channel.item[x].title.xmltext#" target="_blank" class="newsfeed">[view article in new window]</a><br />
<br />
</cfoutput>
</cfloop>
<!--- loop through array to output source --->
<hr />
<blockquote style="text-align:center;">
<cfset SourceLength = arraylen(objRSS.rss.channel)>
<cfloop index="x" from="1" to="#SourceLength#">
<cfoutput>
© #objRSS.rss.channel[x].copyright.xmltext#<br />
<em class="smallfont">(#objRSS.rss.channel.item[x].pubdate.xmltext#)</em><br />
<a href="#replace(objRSS.rss.channel[x].link.xmltext,'&','&','all')#" title="[goto news source in new window]" target="_blank"><img src="#objRSS.rss.channel[x].image.url.xmltext#" hspace="0" vspace="3" border="0" alt="#replace(objRSS.rss.channel[x].link.xmltext,'&','&','all')#" /></a><br />
<br />
</cfoutput>
</cfloop>
</blockquote>
<!--- show message if no updates --->
<cfif ItemsDisplayed EQ 0>
<cfoutput>
No articles currently available.<br />
<br />
</cfoutput>
</cfif>
<!--- catch errors --->
<cfcatch type="any">
<cfoutput>
The connection to the #ucase(url.pullnewsfrom)#'s RSS feed has timed out - please try again later. We are sorry for any inconvenience this may have caused.<br />
<br / >
</cfoutput>
</cfcatch>
</cftry>
</div>
<br />
</td></tr>
<tr><td colspan="2" class="footer">
<cfinclude template="/i/_includes/footer.cfm">
</td></tr>
</table>
</body>
</html>
By the way, all the code nested in the <cftry> tags gets replaced with <cffeed> later this year when ColdFusion 8 is released.
Does that help any? I think you can see just how distinct the CF code is form the HTML. Its one of the things I like - distinct difference between the code that is processed versus used for display.
NOTE: I did not include the source code for the include statements and the file that sets global variables (application.cfm) is also not referenced.