February 28, 2003
Including JSP pages in CFM pages
A thread on cf-talk recently touched on some of the Java integration points with ColdFusion MX (the thread actually started out talking about BlueDragon). One of the questions was whether you could include Java Server Pages in a ColdFusion page. The answer is yes and here's how:cfm.cfm:
<cfoutput>
We're in CFML.<br />
<cfset getPageContext().include('jsp.jsp')>
We're back in CFML.<br />
</cfoutput>
jsp.jsp:
<% String s = new String("JSP"); %>
This is a <%= s %> page.<br />
This produces:
We're in CFML. This is a JSP page. We're back in CFML.You can also forward from ColdFusion pages to JSP using
getPageContext().forward('nextpage.jsp')
Hypothetical Safari Build
Dave Hyatt's Surfin' Safari blog has a curious entry which has generated some very interesting comments. In particular, comments about tabbed browsing caught my eye... A lot of people would be very happy to see tabbed browsing in a future version of Safari so let's hope this isn't quite as hypothetical as it might seem.February 27, 2003
Fusebox via RSS
The Fusebox forums are available as RSS feeds which seems a particularly convenient way to keep up with the latest thoughts on Fusebox.Fusebox 4?
A fairly long thread on cf-talk over the last few days has focused on Fusebox, CFMX and CFCs. I was disappointed to hear that some members of the Fusebox Council do not believe that CFCs are ready for "prime time" and that the work Hal Helms was doing on Fusebox MX - as reported here and elsewhere - will not lead to a version of the core files based on ColdFusion Components.Having seen some early prototypes of Hal's work on a CFC-based Fusebox, I was looking forward to Fusebox MX. I think CFCs are solid enough for enterprise-class production applications and I haven't, yet, seen any specific reasons from the Fusebox community as to why Hal has abandoned CFCs. It seems particularly strange after Hal's article on CFCs on Macromedia's website and his book "Discovering CFCs (ColdFusion MX Components)" - and now an eWorkbook (see Techspedition's website).
However, some good news came out of the thread: John Quarto-vonTivadar commented that in Fusebox 4 you will be able to extend the core quite easily using "plugins". The plug-in architecture of Fusebox MX was one of the things that had excited me about Hal's work so I'm glad that part at least will make it into Fusebox 4.
Update: Hal has taken time to comment on this thread and clarify his position. Please read his comments (especially if you are a Fuseboxer who is saying CFCs are no good should!).
J2EE Sessions & cflocation
There's been a fascinating and somewhat complex discussion on CFGURU about issues with J2EE sessions on CFMX with cflocation. The seed of it all hinges on whether ;jsessionid=XXX is valid in a URL or not. The J2EE specification says that J2EE application servers can insert that into URLs, after the filename but before the ? like this:
http://www.mysite.com/hello.jsp;jsessionid=234354?name=SeanNormally, what happens next is that the J2EE application server's web server connector is passed the URL and it parses out the session ID and the query string.
Consider this URL tho':
http://www.mysite.com/hello.html;jsessionid=234354Some J2EE application server connectors will intercept this and strip the session ID, some won't. It's unclear what the behavior should be and there are arguments in favor of both approaches.
You might ask why this is even an issue - if you're creating a URL to a static page (or to an external server), you simply don't want to add session management information, right? Well, yes, except that if you use
cflocation, you can't avoid jsessionid unfortunately. You can say addToken="false" but CFMX still adds the session ID. That's a bug (#49530) and Phil Costa posted that a fix will be included in Updater 3.
David Grabbe emailed me to ask where to find this fix. Well, it isn't out yet but it prompted me to suggest a workaround: use
cfheader to write out Location: destinationURL instead of cflocation when you want to redirect to another server (or a static page on your own server).
Specifically, you need:
<cfheader statuscode="302" statustext="Temporarily Moved"/> <cfheader name="Location" value="destinationURL"/>You need to set the status code so that the browser honors the location header!
February 26, 2003
The Old Blog
The old archive pages for my erstwhile Blogger-powered blog still exist because there are lots of links out there to old blog entries with Blogger's exotic anchor 'numbers'. I've updated the archive navigation in the old blog to point to the new blog archives. I'm open to suggestions on how best to retire the old blog pages that don't break people's links and don't involve too much work for me!Rendezvous & Apache
Mac OS X Hints (an excellent site!) explains how to register additional sites with Apple's mod_rendezvous. Nice and simple, and effective when you run nearly a dozen different websites on your Mac, like I do.February 24, 2003
Macromedia DevNet & PHP
PHP is featured very highly in the latest Macromedia DevNet update. Lots of articles about building sites in PHP, covering how to set up your environment (Linux, PHP, Apache, MySQL), PHP and IIS, PHP and Mac OS X, PHP and server-side graphics and hand-coding PHP. Take advantage of Dreamweaver MX to build better PHP sites!February 22, 2003
JavaScript & Mac Browsers
A very interesting article in the Apple Developer Connection about JavaScript support in different Mac Browsers. The article reviews the behavior of six browser on Mac OS X against various pieces of JavaScript functionality.February 20, 2003
Categorized
In response to a comment by Justin MacCarthy, I've enabled categories for the blog and I'm in the process of categorizing 200+ historical entries. Bear with me while I get everything organized.Oh, and if anyone knows why the first category in the list (main page, left hand side, under "CATEGORIES") never shows as a link in the MTCategories container...
Thanx to Nathan S for spotting the missing '>'. Doh!
February 19, 2003
!*%$ CSS
I was so proud of my switchover to MT until Dean commented on this entry to point out that it looks terrible on Win IE 5.5. It's looks fine in Safari, Mozilla and Mac IE 5.2.2 but he's right - it looks awful in Win IE 5.5. Drat!I spent an hour diddling with the style sheet and gave up. For now. Sorry. I was planning to create a new style sheet anyway and when I do, I'll test it on Win IE 5.5 to make sure it looks alright.
Threw in a couple of
width: attributes (into the stylesheet template, using MT's admin) and now it works on Win IE 5.5 as far as I can tell. Let me know if you disagree.
First Comment
Kudos to Ray Camden for being the first person to post a comment against my new MT blog - so he gets a plug for his own blog which is pretty interesting reading.Movable Blog
Bit of a surprise? Yes, I've moved my blog to use Movable Type directly on my site instead of relying on Blogger (sorry, Blogger!). I decided I wanted a proper RSS feed. I'll diddle with the template at some point so it doesn't look just like every other MT blog.
It was fairly straightforward to move the site: MT has great instructions for exporting everything from Blogger and importing it into MT. Good work folks!
This also means my gentle readers can post comments as well as having trackback enabled. No doubt I'll make a bunch more changes as I learn to use MT over the next few weeks.
NetNewsWire
Like many others, I've finally been drawn to trying NetNewsWire to read blogs. My first reaction was "Ugh! It's like going back to USENET" but after an hour or two of picking up RSS feeds I realized that it's pretty darn convenient, especially since I can now browse the latest tidbits on my favorite blogs during my commute to work. It's crashed on me a few times, mostly when messing with the weblog editor, but it's an interesting little tool. It's also made me even more convinced that I need to move my blog off Blogger and onto something that let's me mess with the RSS-level feed much more easily. One day.
Read Freehand files in Flash
I just spotted this on Mesh's blog:
"We just released a FreeHand MX Reader for Flash MX. What does it do? From the download page: The FreeHand MX Reader for Flash MX allows Flash MX to import files that are stored in FreeHand 8, FreeHand 9, FreeHand... [mesh on mx]"
February 17, 2003
C# and the CLI... on a Mac
I was idly reading up about C# (Microsoft's version of Java, as far as I'm concerned) and typed "C# Mac OS X" into Google just out of curiosity. It led to me this MSDN downloads page where I discovered that Microsoft has released a reference implementation of ECMA-334 (C#) and ECMA-335 (Common Language Infrastructure) under the Microsoft Shared Source Initiative. I downloaded the 122Mb source tarball, unpacked it and built the system (which took quite a while!). Now I have a fully-functional C# compiler on my Mac which is interesting to compare C# with Java (and C++). The slightly more surreal part is that I can also run .exe managed executables on my Mac. This is kinda cool!
Weather Web Service Revisited
Thanx go to Travis, who emailed me via the contact link to point out that the weather web service I wrote up has another nice feature: getIconIndex(). Travis sent me the location of the icons so you can use them yourself by putting the following code in your page:
<img src="http://www.ejse.com/WeatherService/images/52/#Weather.getIconIndex()#.gif">
February 16, 2003
Webapper
Mike Brunt's weblog is full of Tips for Web Architects from Web Architects and I've been meaning to mention it here for a couple of months. Check it out!February 14, 2003
MXDU
As some folks have noticed, the MXDU keynotes have been updated and I am no longer speaking. I am very grateful to Branden Hall for stepping up at such short notice to take over my day 2 keynote slot. I'm very disappointed that work commitments make it impossible for me to attend the conference, especially since the change of plans has come at the eleventh hour.
February 13, 2003
Safari Updated
A new public beta is available from Apple's website. Hard to tell what's different except that Flash seems snappier and I guess they fixed a bunch of bugs. They still haven't fixed the img align left/right problem I reported, you still don't seem to be able to sign-in to Hotmail and Flash Remoting still doesn't work but, hey, it's still in beta. There doesn't appear to be any new functionality... the Debug menu hack still works although the force-full-screen hack no longer does which is a bummer. Overall, a disappointing update for me but I still love the browser and it remains my primary browser.
February 11, 2003
Web Service Returns
Sometimes it's hard to figure out what a Web Service returns. Take this one for example: http://www.ejse.com/WeatherService/Service.asmx?wsdl. What, exactly, do you get back when you call it from CFMX? This is another case where cfdump is your friend:
<cfinvoke
webservice = "http://www.ejse.com/WeatherService/Service.asmx?wsdl"
method = "GetWeatherInfo"
zipCode = "94546"
returnvariable = "Weather">
<cfdump var="#Weather#">
What you get back is a Java object, with a bunch of methods. This is a proxy object for the return type of the Web Service. Not entirely obvious, is it? A quick perusal of the methods should lead you to write something like this to display the result:
Weather for location: #Weather.getLocation()#
Temp: #Weather.getTemprature()#
Feels like: #Weather.getFeelsLike()#
Forecast: #Weather.getForecast()#
Visibility: #Weather.getVisibility()#
Pressure: #Weather.getPressure()#
DewPoint: #Weather.getDewPoint()#
UVIndex: #Weather.getUVIndex()#
Humidity: #Weather.getHumidity()#
Wind: #Weather.getWind()#
Reported at: #Weather.getReportedAt()#
Last updated: #Weather.getLastUpdated()#
The next thing we need is a utility to take WSDL and tell us how to call it from CFMX, i.e., tell us what arguments - and what types - we need to pass to the Web Service!
More on SWF Presentations
To the anonymous person who emailed me via my website contact form: no, I am not using Keynote (Apple's presentation software). There's a number of reasons for that. First, it would cost me $99. I like free software (OpenOffice is my free replacement for PowerPoint). Second, it isn't a Macromedia product. I try to use Macromedia products where I can, and free software where I can't. I make few exceptions (SQL Grinder - from Advenio Software - and Watson - from Karelia Software - spring to mind). Third, it doesn't appear to export to Flash which is my primary requirement right now. Interestingly, it seems to import Flash...
maximize.
A new version of the Studio MX product appeared yesterday which I ought to have mentioned, alongside DevNet Subscriptions. Studio MX Plus now contains Freehand MX - a major upgrade - as well as Contribute and a special DevNet Resource Kit CD. Mac users have Studio MX - no "Plus" - which omits ColdFusion MX, Contribute and the Resource Kit although you can download free copies of JRun 4 and CFMX for J2EE for Mac OS X. The only thing I really miss about switching from Windows to Mac is not being able to run Contribute...February 10, 2003
SWF Presentations
I always feel guilty when I create a presentation in PowerPoint (or, more recently, OpenOffice) because I feel I ought to be using Flash... But I just don't find it easy enough when I'm in a rush become I'm not proficient enough with Flash (yet). That's why I was pleased to see the purchase of Presedia recently and why I like this article from Joanne Watkins about using Freehand MX to create Flash presentations. Another reason for me to learn to use Freehand!
DevNet
The Designer & Developer Center has been rebranded DevNet as part of the DevNet Subscriptions offering. Read Mike Chamber's article on what this means to the MX developer in the street.
February 08, 2003
Craig Kelly
I was saddened to read of the death of snowboarding legend, Craig Kelly - [story on mountainzone, transworld snowboarding] - a few days ago. Some friends of mine just left England for Canada and had been planning to hang out with him, when they'd originally planned the trip. Craig was an incredible talent - probably the best snowboarder in the world - and his loss will be felt throughout the boarding community worldwide. The only consolation is that he died doing what he loved.
February 06, 2003
UML Modeler for Flash
Just saw this referenced in Jeremy's blog. Grant Skinner's gModeler.com - free online UML diagramming and documentation tool. I'm a big fan of visual modeling anyway - and this is a very cool and useful little tool. I found it very easy to use and very fast. It really does feel like a full-blown desktop UML tool (although obviously an early release). One to watch!Observant People!
We did a test deployment of our soon-to-be-released new website last night and, although it was only up for a short time before, quite a lot of people noticed! To those who saw it: I hope you liked what you saw? Some of the write ups we've seen during the day are very encouraging. To those who missed it: don't worry, the new website will be launched soon...
February 05, 2003
CFML Forever!
The rallying call of Vince Bonfanti of New Atlanta, makers of Blue Dragon, in a soon to be published column for CFDJ (PDF). Interesting to hear the background to his company's product, as well as news of a .Net release. This is all very positive for ColdFusion, in my opinion.
February 04, 2003
CFMX for J2EE Compile Script - JRun version
I decided to post the JRun version of this script after all. It's quite a bit more sophisticated than the Tomcat one I published yesterday. This one will compile everything in the current directory (and below) by default, or you can specify a directory to compile. It also assumes your server instances all begin withcfmx and it will compile the code into all of them, and it assumes your context root is cfusion. Feel free to mess with it for your own installation.
#!/bin/sh
# adjust this to match the environment:
JRUNHOME=/home/jrun
JAVA=java
# where to compile (it's recursive):
if test "$1" = ""
then
COMPILEDIR=`pwd`
else
COMPILEDIR=$1
fi
# location of javax servlet stuff:
JLIBDIR=$JRUNHOME/lib/jrun.jar
# loop over installed cfmx instances:
for WEBROOT in $JRUNHOME/servers/cfmx*/cfusion
do
WEBINF=$WEBROOT/WEB-INF
CP=$WEBINF/cfusion/lib/cfusion.jar:$WEBINF/lib/cfx.jar:$JLIBDIR
$JAVA -classpath $CP coldfusion.tools.Compiler \
-webroot $COMPILEDIR -webinf $WEBINF $COMPILEDIR
done
This is actually the version from my Mac laptop but it's identical to the one we're using on Solaris, except for the value of JRUNHOME.
Java Flash Remoting with CFMX for J2EE
Several people have commented that if you put CFMX for J2EE on top of JRun, you ought to be able to access Java via the Flash Remoting gateway. First off, why was it disabled? Mostly it's a security issue: if a Flash movie could access Java classes within the ColdFusion system, it can do quite a bit of damage (consider theServiceFactory!). However, if you really want to enable some Java functionality within the ColdFusion Flash Remoting gateway, edit the web.xml file in the WEB-INF directory and, in the flashservices Servlet definition, add the following:
<init-param>
<param-name>DISABLE_JAVA_ADAPTERS</param-name>
<param-value>false</param-value>
<description>When set to true, this setting disables
the Java Adapters in the gateway.</description>
</init-param>
This will enable the Java Bean Adapter and the Java Class Adapter. It will not enable the EJB or Servlet Adapters. More on that later I hope.
February 03, 2003
CFMX for J2EE Compile Script
I spent a little time reworking the CFMX compile script so that it will work with CFMX for J2EE. Here's a version that works with Tomcat (on Mac OS X):#!/bin/sh WEBROOT=/home/tomcat/webapps/cfmac JLIBDIR=/home/tomcat/common/lib/servlet.jar J2EEWEBINF=$WEBROOT/WEB-INF J2EEMX=$J2EEWEBINF/cfusion JAVA=java $JAVA -classpath $J2EEMX/lib/cfusion.jar:$J2EEWEBINF/lib/cfx.jar:$JLIBDIR \ coldfusion.tools.Compiler -webroot $1 -webinf $J2EEWEBINF $1Note that
WEBROOT will need to change to wherever the context root is for your installation. I have a slightly more sophisticated version that works with JRun and handles multiple CFMX installations (i.e., multiple server instances). If there's sufficient interest, I'll post it here.