Physics Plots for ColdFusion and JSP Pages

Author: Matt Langston

Introduction

I've spent part of the past 8 months working on a set of tags that can be used in any ColdFusion or JSP page to produce physics plots. These tags are collectively called the AIDA Tag Library. The following documentaion serves as the primary resource for using these tags in ColdFusion and JSP pages.

History

This work is based on the excellent Java implementaion of AIDA called JAIDA, and has been in collaboration with Tony Johnson and Max Turri, two of the primary developers of JAIDA. Both AIDA and JAIDA are part of the FreeHEP project.

The tags I wrote are a super ser of another set of tags being worked on by Tony and Max. The current differences are that my tags were designed to work on all ColdFusion and JSP servers. JSP servers have been around a long time, and Sun Microsystems has released three different versions of JSP servers. My support all of these versions. Additioanlly, due to

We have a committment from Tony and Max to merge this existing work with FreeHEP so that these tags can take advantage of support and development of a larger team. The syntax of the tags will not change.

Installation on ColdFusion

Install the the AIDA Tag Library on a ColdFusion server by following these simple steps. The instructions below refer to the ColdFusion root directory as cf_root. On my Windows workstation this is C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war. If you installed ColdFusion using the default settings, this is what you will have on your workstation too.

  1. Download the latest AIDA Tag Library distribution
  2. Unzip this file into the directory cf_root/WEB-INF/. The unzipped folder will be called aida. On my workstation, I used WinZip to unzip the distribution to C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/aida.
  3. Download the modified ColdFusion web.xml
  4. Male a backup of cf_root/WEB-INF/web.xml (I simply renamed mine to web.xml.orig) and copy the file you just downloaded to cf_root/WEB-INF/web.xml.
  5. Restart your ColdFusion server. This is typically done on a Windows workstation by right-clicking the entry Macromedia JRun CFusion Server in the Services applet (Control Panel, Administrative Tools, Services) and clicking "Restart".

Modifications to the ColdFusion web.xml (for reference purpoeses only)

Copying the modified web.xml file to cf_root/WEB-INF/web.xml as described above is the easiest (and recomended) way to install the ADIA Tag Librar on a ColdFusion server. However, for reference (and the curious amongst us), I also outlined necessary modifications below:

  1. Edit cf_root/WEB-INF/web.xml to prepend cf_root/WEB-INF/aida to ColdFusion's classpath:
    <context-param id="macromedia_context_88">
      <param-name>cf.class.path</param-name>
      <param-value>
        ./WEB-INF/aida,
        ./WEB-INF/cfusion/lib/updates,
        ./WEB-INF/cfusion/lib,
        ./WEB-INF/cfusion/gateway/lib,
        ./WEB-INF/cfform/jars
      </param-value>
    </context-param>
    
  2. Edit cf_root/WEB-INF/web.xml and add this <context-param> definition after all the other <context-param> definitions (but before the <filter> definitions):
    <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>./WEB-INF/aida/applicationContext.xml</param-value>
    </context-param>
    
  3. Edit cf_root/WEB-INF/web.xml and add these two AIDA <servlet> definitions after all the other <servlet> definitions (but before the <servlet-mapping> definitions):
    <servlet>
      <servlet-name>context</servlet-name>
      <servlet-class>coldfusion.bootstrap.BootstrapServlet</servlet-class>
      <init-param>
        <param-name>servlet.class</param-name>
        <param-value>org.springframework.web.context.ContextLoaderServlet</param-value>
      </init-param>
      <load-on-startup>19</load-on-startup>
    </servlet>
    <servlet>
      <servlet-name>aida_plot</servlet-name>
      <servlet-class>coldfusion.bootstrap.BootstrapServlet</servlet-class>
      <init-param>
        <param-name>servlet.class</param-name>
        <param-value>hep.aida.web.spring.controller.servlet.ColdFusionDispatcherServlet</param-value>
      </init-param>
      <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/aida/aida_plot-servlet.xml</param-value>
      </init-param>
      <load-on-startup>20</load-on-startup>
    </servlet>
    
  4. Edit cf_root/WEB-INF/web.xml and add this <servlet-mapping> all the other <servlet-mapping> definitions (but before the <welcome-file-list> definitions):
    <servlet-mapping>
      <servlet-name>aida_plot</servlet-name>
      <url-pattern>/aida_plot.jsp</url-pattern>
    </servlet-mapping>
    

Installation on a Vanilla JSP Server (like Tomcat)

Installing a tag library on a JSP server is much more complicated, and requires that you know what you are doing (this will require the expertise of a J2EE developer to help you). The easiest way to get going is to deploy the aidatld.war that comes with the distribution and look at how I have things set up. If there is interest I will expand this part of the documentation for developer community.

Making Physics Plots

There are two example applicaitons I deployed to the glast-ground web server. Both of these example applications allow you to click on a series of exampls to view the plots and to also click the "View Source" link at the upper right-hand section of each page to see the actual code that was used to create the plot. You can cut-and-paste this code into your own pages.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.