Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a static method with a struts variable

 
Frank Bueckert
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not exactly sure how to go about this. I'm using the JFreeChart jar file to generate a dynamic image based on the data I'm using. That's all fine and dandy.
My problem is accessing a variable I'm defining in the action, and using it in a scriptlet to write an imagemap straight into the JSP.

This defines the variable for the JSP. That part works fine. However, when I try to use it in a scriptlet, it turns up as null.


I've tried using "info", "(org.jfree.chart.ChartRenderingInfo) info", and any other variations I can come up with. I know I'm doing something wrong, but I have no idea what.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't nest one Struts tag inside another.

change your <bean:define>tag to:

<bean:define id="info" type="org.jfree.chart.ChartRenderingInfo" scope="page" name="graphForm" property="info"/>

If you do this, your scriptlet should work.

You could also try getting the info bean directly from the ActionForm, as in:

[ July 18, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic