Galleon Forum Ports Comparisons

Browser Redirection

back

Here are some samples of how redirection is performed in the frameworks I've chosen for this project.

ColdBox: /handlers/myHandler.cfc
<cffunction name="myEvent">
	<cfargument name="event" required="true" />
	... do stuff ...
	<cfset setNextEvent("Handler.Event"[,"query_string=parameters"]) />
</cffunction>
Fusebox (traditional): /controller/circuit.xml
<fuseaction name="myEvent">
	... do stuff ...
	<relocate url="index.cfm?fuseaction=circuit.event" />
</fuseaction>
Fusebox (CFC): /controller/circuit.cfc
Either URL or XFA are required - not both
<cffunction name="myEvent">
	<cfargument name="myFusebox" required="true" />
	<cfargument name="event" required="true" />
	... do stuff ...
	<cfset myFuseBox.relocate([url="index.cfm?fuseaction=circuit.event" or xfa="myXFA"]) />
</cffunction>
Mach-II: /config/mach-ii.xml
persistArgs variables are delivered to the following page (I'm guessing via session)
<event-handler event="myEvent">
	... do stuff ...
	<redirect event="myRedirectEvent" [persist="true"] [persistArgs="list,of,event,args,to,persist"] />
</event-handler>
Model-Glue: /config/ModelGlue.xml
variables in the append attribute are added to the query string on the following page
<event-handler name="myEvent">
	<broadcasts>
		... do stuff ...
	</broadcasts>
	<results>
		<result do="nextEvent" redirect="true" append="someVar,anotherVar,thirdVar" />
	</results>
</event-handler>

onTap: The method of relocation in the onTap framework depends quite a lot on the context. There are several different methods of relocating, some of which relocate immediately - others are defined for the purpose of embedding into JavaScript to cause redirection associated with user interaction (AJAX). The optional "domain" argument is used to get access to the framework's URL domain aliases, so that for example, a given URL may target a page within the store using "store" as the domain, regardless of where the store is actually located. This helps to decouple the view, so the store can be moved during later development without needing to modify any of the links to the store. You might consider this the link and URL equivalent of ColdFusion server mappings.

Here is the most common form of redirection

/_components/[mycircuit]/_local/100_dothings.cfm
... save my form ... 
<cfset tap.goto.href = "thankyou.cfm" /> 
[<cfset tap.goto.domain = "feedback" />]