Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How to use jFreechart in struts2

How to use jFreechart in struts2

Scheduled Pinned Locked Moved Java
javaapachealgorithmsdata-structuresxml
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cmaheshwari16
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • C cmaheshwari16

      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

      C Offline
      C Offline
      cmaheshwari16
      wrote on last edited by
      #2

      Pls help and provide the way .....

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups