posts - 68, comments - 19, trackbacks - 0, articles - 1

Struts2整合jfreechart

Posted on 2012-02-28 19:12 viery 阅读(179) 评论(0)  编辑  收藏 所属分类: Struts2



action

xml配置

<struts>
<constant name="struts.i18n.encoding" value="gbk"/>
 <package name="toupiao" extends="jfreechart-default">
   <action name="Toupiao" class="org.vle.action.TpupiaoAction">
     <result name="success" type="chart">
        <param name="width">800</param>
        <param name="height">600</param>
     </result>
  </action>
 </package>

</struts>

投票jsp

  <body>
   投票<br/>
   <s:form action="Toupiao">
 <s:checkbox name="toupiao" label="足球" fieldValue="zu"></s:checkbox>
 <s:checkbox name="toupiao" label="蓝球" fieldValue="lan"></s:checkbox>
 <s:checkbox name="toupiao" label="排球" fieldValue="pai"></s:checkbox>
 <s:checkbox name="toupiao" label="羽毛球" fieldValue="yu"></s:checkbox>
 <s:submit value="投票"></s:submit>
   </s:form>

  </body>

需要引入jfreechart的插件包


只有注册用户登录后才能发表评论。


网站导航: