How to display the Helloworld using fusebox technology?
Step 1
First off, download the core files from the website of Fusebox. I am
going to be working in the folder D:\project\TestDocument accessible via my
browser as http://localhost/FB4.
Since this is a web application, we need the web server. I
have used the web server named Internet Information services (ISS). In the IIS,
create the virtual directory FB4 whose local Path is D:\Project\ TestDocument
in the properties.
Step 2
Create a cfm file called as dsp_helloworld.cfm in that folder
containing the following code.
Listing 11
<html>
<head>
<title>
Hello World
</title>
</head>
<body>
<h3>Hello World!!</h3>
</body>
</html>
Now we have the display file that will display the message,
but we need to do a little more to get the application to work.
Step 3
Create another file called circuit.xml.cfm. This file uses
the XML to define the fuseaction within a particular circuit in the application.
Listing 12
<circuit access="public">
<fuseaction name="helloworld">
<include template="dsp_helloworld.cfm" />
</fuseaction>
</circuit>
Step 4
In this step we need to edit the fusebox.xml file to asign
an alias to the circuit. The top the fusebox.xml contains the code.
Listing 13
<circuits>
<circuit alias="main" path="" parent="" />
</circuits>
Since we are creating simple application we do not need to
worry about the path and parent attributes and change the alias name to
document.
Listing 14
<circuits>
<circuit alias="document" path="" parent="" />
</circuits>
Finally, we need to set the value of defaultFuseaction of
fusebox.xml to document.helloworld.
Open the browser and run the application via http://localhost/FB4 or http://localhost/FB4/index.cfm?fuseaction=document.helloworld.
If all goes well, you should see "Hello World!!"
Figure 1