Open Bluedragon Eclipse WAR Project
I'm using the JEE Eclipse version which contains all the plugins needed to run the sample below.
You'll also need to download and unpack the Apache Tomcat binaries.
Open Eclipse and from the "File" menu choose "New -> Other ->" and then "Web -> Dynamic Web Project" from the New Project Wizard window.
Enter "OpenBDWar" as the Project Name.
Under the Target Runtime setting choose "New...". From the "New Runtime" settings window choose the "Apache -> Apache Tomcat 6" ( or the corresponding version number you have downloaded ) and click the "Next..." button.
In the next settings window, chose the path to the root folder where you downloaded and unpacked Apache Tomcat. The root folder is the top folder that contains the bin, lib, and webapps folders.
[caption id="attachment_12" align="alignnone" width="445" caption="eclipse new server runtime apache 6 setup"]
Click "Finish" and you will be taken back to the New Project setup window. The runtime should now have Apache Tomcat listed as the target runtime and configuration. Click "Finish" in the new project window to accept the settings ( advanced users: you may "Next..." through the rest of the settings for the new project but the defaults should suffice for what we're doing ).
You should now have a new project in your Project Explorer that resembles the layout below.
Next we'll need to download Open Bluedragon and integrate it into our new OpenBDWar project.
openbluedragon.war and extract it to a new folder; we'll use openbluedragonwarfolder for this example.
$> cd openbluedragonwarfolder
$> jar -xvf openbluedragon.war
The openbluedragonwarfolder should now contain an
index.jsp file, a
WEB-INF folder and the original
Copy all the folders inside the
WEB-INF folder to your
WebContent/WEB-INF folder inside your OpenBDWar project in Eclipse. Do not copy the web.xml file as we'll update it by hand next. You may be prompted to overwrite the
WEB-INF/lib folder if it exists.
Next copy the
index.jsp files and the
bluedragon folder inside the extracted openbluedragonwarfolder and paste them into the
WebContent folder inside your OpenBDWar project.
Now we'll need to update the
web.xml file manually. Open the
WebContent/WEB-INF/web.xml file in Eclipse and update it to look like the file below.
OpenBDWar com.naryx.tagfusion.cfm.application.cfHttpSessionListener cfmServlet com.naryx.tagfusion.cfm.cfServlet BLUEDRAGON_WORKING_DIRECTORY /WEB-INF/bluedragon/work BLUEDRAGON_XML /WEB-INF/bluedragon/bluedragon.xml 1 cfcServlet com.naryx.tagfusion.cfm.cfcServlet 2 cfchartServlet com.naryx.tagfusion.cfm.cfchartServlet cfmServlet *.cfm cfcServlet *.cfc cfchartServlet *.cfchart 30 txt text/plain pdf application/pdf swf application/x-shockwave-flash gif image/gif jpeg image/jpeg svg image/svg+xml html text/html xml text/xml htm text/html jpg image/jpeg css text/css index.html index.htm index.jsp index.cfm default.html default.htm default.jsp default.cfm
Save and Close the
The project should now be configured to run your CFML applications with the default OpenBluedragon settings. You can edit the
WEB-INF/bluedragon/bluedragon.xml file to fit your needs. See Openbluedragon Google groups for
bluedragon.xml configuration settings.
You can test your installation with the local Apache Tomcat server we configured earlier by right-mouse clicking on the OpenBDWar project in Eclipse and choosing "Run As... -> Run on Server" and selecting the Apache Tomcat server from the list of servers on localhost. Check the "Always use this server when running this project" check box so that you don't have to specify this each time and then click finish.
You'll see the log messages in Eclipse's console window as Eclipse starts and configures Tomcat with your OpenBDWar webapp.
Once the server starts Eclipse should open up it's integrated with the browser with the webapp's root and you should see the
http://localhost:8080/OpenBDWar/index.cfm in the location bar and hit enter to view the
You can then start adding
.cfc CFML files to your project under the
WebContent folder in your OpenBDWar project and view them by navigating to their respective URL in the browser.
You do not need to restart the server to modify your CFML pages, the changes are automatically picked up by the deployment as long as you don't have any caching enabled.