Hi,

I created a simple action class to generate a chart. I use the
struts-jfreechart plugin to get the chart result type. I now want to
render the chart by doing something like this in a jsp:

 

<s:url id="ajaxChartUrl" value="/viewSimpleXYChart.html"/>

<s:div theme="ajax"

               href="%{ ajaxChartUrl }" loadingText="Loading Chart..." >

</s:div>  

 

My struts.xml is configured as follows:

 

        <package name = "chart" extends="jfreechart-default">

           <action name="ViewSimpleXYChart"
class="cam.webapp.action.XYChartAction" >

             <result name="success" type="chart">

               </result>

            </action>

         </package>

 

If I use menu to point to viewSimpleXYChart.html, the action is hit and
the chart displayed in a blank page, however hitting the jsp with the
ajax stuff does nothing (no error traces), actions execute() method is
simply not accessed.

 

Also I thought the following would work from a normal appfuse jsp page

 

<img:image src="/viewSimpleXYChart.html"/>

 

But it seems to be the same problem. I am sure I am missing something
fundamentally simple here. The action will generate the chart as png,
and the getChart method place it on the value stack and the references
in the jsp get it from there and display it in the <s:div section ? I
intend using this type of ajax method for a dashboard using Jfreecharts.

 

Thanks

Travers 

Reply via email to