struts2 + jfreechart + jsp : lost request parameters in action which generates Jfreechart -
1)i called action generates jfreechart using next jsp(using tiles) code :
<s:url var="chart" action="resultchart"/> <img src="<s:property value="%{chart}"/>"/>
2)struts.xml
<package name="chart" extends="jfreechart-default" namespace="/"> <action name="resultchart" class="com.examples.actions.chartaction"> <result name="success" type="chart"> <param name="width"> 1200 </param> <param name="height"> 600 </param> </result> </action> </package>
3)to generate chart - use request parameters previous action :
public class chartaction extends actionsupport implements requestaware { private static final long serialversionuid = 1l; private map request; private jfreechart chart; public string execute() throws exception { databean databean = (databean)request.get("databean"); ..... }
my problem next : cant draw chart because request return null(databean=null) note : without passing request parameters works fine
my research - used next code in chartaction(before request.get) investigate problem:
valuestack valuestack = actioncontext.getcontext().getvaluestack(); system.out.println("valuestack.size() = " + valuestack.size()); system.out.println("valuestack root = " + valuestack.getroot().tostring());
and saw in valuestack no records action put parameter(databean) request
please help
Comments
Post a Comment