• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calling a static method with a struts variable

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic