Ben, it seems what you're looking for is the equivalent of a server transfer in
CFML. That is enabled in CFMX by way of
getpagecontext().forward("yourtemplate.cfm"). Yes, it's an odd looking beast.
The getpagecontext() function returns an
object with several methods, one of which is a forward, which does the server
side transfer you seek. I wrote about this
in a June 2002 CFDJ article, back when it came out in CFMX 6.0:
New Possibility in CFMX: Server-Side Redirects
http://www.sys-con.com/story/?storyid=41768&DE=1
I indicated then that it seemed ideal for MVC-style programming. It had some
issues then (which were fixed in subsequent
updaters and releases), though some still remain. You'll want to carefully
consider the points raised in the article
(and the feedback for it at the article's page on the CFDJ site).
Another method in the pagecontext is include(), which has some advantages over
(and important differences from) a
regular cfinclude. It's designed primarily to include the output of some
non-CFM page into a CFML page, but could be
used for a regular CFM page (in which case it executes the application.cfm and
any onrequestend.cfm, but it doesn't
share the local variable scope). I covered that as part of a larger article in
the July 2003 CFDJ:
The Secret Powers of Includes
http://www.sys-con.com/story/?storyid=42051&DE=1
I'll also point out that in BlueDragon we simply wrapped the forward ability
into a new tag, called CFFORWARD, which
takes a PAGE attribute naming the file to transfer to. We also wrapped up the
include of an external page with a new
PAGE attribute for CFINCLUDE.
Charlie Arehart
CTO, New Atlanta Communications, makers of BlueDragon
(678) 256-5395 [EMAIL PROTECTED]
www.newatlanta.com/bluedragon/
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ben Nadel
> Sent: Thursday, December 08, 2005 9:31 AM
> To: [email protected]
> Subject: RE: [CFCDev] MVC exploration questions
>
> Hugo,
>
> It just seems that in an MVC world, the Controller would want
> to perform a Server transfer rather than a CFLocation so that
> it would be directly deciding which view to return to the
> browser, rather than the indirect way of sending a path
> request that would then send an additional page request??
>
> ......................
> Ben Nadel
> Web Developer
> Nylon Technology
> 6 West 14th Street
> New York, NY 10011
> 212.691.1134
> 212.691.3477 fax
> www.nylontechnology.com
>
> "Vote for Pedro"
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]