Struts 2
  1. Struts 2
  2. WW-2742

Paramters not being set in JFreeChart Plugin

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.8
    • Component/s: Other
    • Labels:
      None

      Description

      <action name="ch" class="org.someorg.chart.ChartAction">
      <result name="success" type="chart">
      <param name="width">$

      {width}

      </param>
      <param name="height">$

      {height}

      </param>
      </result>
      </action>

      In the above case I am getting an IllegalArgumentException, although I have defined width and height in ChartAction

      public class ChartAction extends ActionSupport
      {

      private static final long serialVersionUID = -4845276888116145855L;

      private Integer width = 200;
      private Integer height = 400;

      public String execute() throws Exception

      { chart = new chart.. return SUCCESS; }

      public Integer getWidth()

      { return width; }

      public void setWidth(Integer width)

      { this.width = width; }

      public Integer getHeight()

      { return height; }

      public void setHeight(Integer height)

      { this.height = height; }

      }

        Activity

        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:17:42 UTC 2010 [ 1264987062082 ]
        Wes Wannemacher made changes -
        Fix Version/s 2.1.7 [ 21907 ]
        Fix Version/s 2.1.8 [ 21920 ]
        Rainer Hermanns made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Rainer Hermanns added a comment -

        added improvement to trunk

        Show
        Rainer Hermanns added a comment - added improvement to trunk
        Rainer Hermanns made changes -
        Fix Version/s 2.1.7 [ 21907 ]
        Fix Version/s 2.1.8 [ 21920 ]
        Rainer Hermanns made changes -
        Assignee Dave Newton [ newton_dave ] Rainer Hermanns [ rainerh ]
        musachy made changes -
        Fix Version/s 2.1.8 [ 21920 ]
        Fix Version/s 2.1.7 [ 21907 ]
        Hide
        Dave Newton added a comment -

        Hmm, apparently I didn't do it that weekend. Bump it; there's no way I'll get to it within < 2 weeks.

        Show
        Dave Newton added a comment - Hmm, apparently I didn't do it that weekend. Bump it; there's no way I'll get to it within < 2 weeks.
        Hide
        musachy added a comment -

        Dave any news on this, or should I bump it?

        Show
        musachy added a comment - Dave any news on this, or should I bump it?
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 49238 ] Struts - editable closed status [ 50117 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 45272 ] Struts - editable closed status (temporary) [ 49238 ]
        musachy made changes -
        Fix Version/s 2.1.7 [ 21907 ]
        Fix Version/s 2.1.6 [ 21906 ]
        musachy made changes -
        Fix Version/s 2.1.5 [ 21905 ]
        Fix Version/s 2.1.6 [ 21906 ]
        Wes Wannemacher made changes -
        Fix Version/s 2.1.5 [ 21905 ]
        Fix Version/s 2.1.4 [ 21865 ]
        musachy made changes -
        Fix Version/s 2.1.3 [ 21864 ]
        Fix Version/s 2.1.4 [ 21865 ]
        Dave Newton made changes -
        Assignee Dave Newton [ newton_dave ]
        Dave Newton made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Hide
        Dave Newton added a comment -

        Changing to improvement, I should be able to do it this weekend; if not I'll bump to 2.1.4.

        Show
        Dave Newton added a comment - Changing to improvement, I should be able to do it this weekend; if not I'll bump to 2.1.4.
        Hide
        Wes Wannemacher added a comment -

        James / Herak,

        the chart result type does not have any logic for parsing OGNL parameters. This was discussed a while back on user@struts.apache.org ->

        http://www.nabble.com/Dynamic-Results-td15488767.html

        I think we should close this JIRA or change it to an improvement request.

        -Wes

        Show
        Wes Wannemacher added a comment - James / Herak, the chart result type does not have any logic for parsing OGNL parameters. This was discussed a while back on user@struts.apache.org -> http://www.nabble.com/Dynamic-Results-td15488767.html I think we should close this JIRA or change it to an improvement request. -Wes
        Hide
        Herak added a comment -

        stack trace
        java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
        at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:324)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1396)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1378)
        at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:170)
        at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:123)
        at org.apache.struts2.dispatcher.ChartResult.execute(ChartResult.java:110)
        at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
        at com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor.intercept(AnnotationWorkflowInterceptor.java:121)
        at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
        at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
        at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
        at org.someorg.UserAuthenticationInterceptor.intercept(UserAuthenticationInterceptor.java:49)
        at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
        at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
        at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
        at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
        at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
        at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:637)

        Show
        Herak added a comment - stack trace java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999) at java.awt.image.BufferedImage.<init>(BufferedImage.java:324) at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1396) at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1378) at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:170) at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:123) at org.apache.struts2.dispatcher.ChartResult.execute(ChartResult.java:110) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor.intercept(AnnotationWorkflowInterceptor.java:121) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at org.someorg.UserAuthenticationInterceptor.intercept(UserAuthenticationInterceptor.java:49) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:637)
        James Holmes made changes -
        Field Original Value New Value
        Fix Version/s 2.1.3 [ 21864 ]
        Hide
        James Holmes added a comment -

        Can you post a full stack trace?

        Show
        James Holmes added a comment - Can you post a full stack trace?
        Herak created issue -

          People

          • Assignee:
            Rainer Hermanns
            Reporter:
            Herak
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development