How to use jFreechart in struts2
-
Hi All,
I am little bit new to struts framework though I have used tiles in struts application. Now I want to display charts in my application. After searching I found jFreechart library to create charts. (Though it doesn't generate all the charts, like box in web application).
Now I also found some link on how to use jFreechart in struts application. Though the post are not much descriptive, I tried in the same way to incorporate the chart functionality but it is not working......
Can someone please provide the entries to be made in [B]struts.xml[/B], [B]web.xml[/B] to make this functionality work.
Pls find below the different files I am using to run my application.
I have made the changes that I made for graph functionality in bold[B][I][U]Struts.xml[/U][/I][/B]
[CODE]<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts><constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<!--
<package name="actionGraph" namespace="/actionGraph" extends="jfreechart-default">
<action name="Graph" class="graph.Graph">
<result name="success" type="chart">
<param name="value">chart</param>
<param name="type">png</param>
<param name="width">640</param>
<param name="height">480</param>
</result></action>
</package>
--><package name="portal" namespace="/portal" extends="struts-default , [B]jfreechart-default[/B]
"><result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>\[B\]<result-type name="chart" class="org.apache.struts2.dispatcher.ChartResult"> <param name="height">150</param> <param name="width">200</param> </result-type>\[/B\]
</result-types>
<global-results>
<result name="error">/pages/error.jsp</result>
</global-results><global-exception-mappings>
<exception-mapp -
Hi All,
I am little bit new to struts framework though I have used tiles in struts application. Now I want to display charts in my application. After searching I found jFreechart library to create charts. (Though it doesn't generate all the charts, like box in web application).
Now I also found some link on how to use jFreechart in struts application. Though the post are not much descriptive, I tried in the same way to incorporate the chart functionality but it is not working......
Can someone please provide the entries to be made in [B]struts.xml[/B], [B]web.xml[/B] to make this functionality work.
Pls find below the different files I am using to run my application.
I have made the changes that I made for graph functionality in bold[B][I][U]Struts.xml[/U][/I][/B]
[CODE]<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts><constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<!--
<package name="actionGraph" namespace="/actionGraph" extends="jfreechart-default">
<action name="Graph" class="graph.Graph">
<result name="success" type="chart">
<param name="value">chart</param>
<param name="type">png</param>
<param name="width">640</param>
<param name="height">480</param>
</result></action>
</package>
--><package name="portal" namespace="/portal" extends="struts-default , [B]jfreechart-default[/B]
"><result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>\[B\]<result-type name="chart" class="org.apache.struts2.dispatcher.ChartResult"> <param name="height">150</param> <param name="width">200</param> </result-type>\[/B\]
</result-types>
<global-results>
<result name="error">/pages/error.jsp</result>
</global-results><global-exception-mappings>
<exception-mappPls help and provide the way .....