• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

CeWolf - Send HttpSession to DataProducer

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Experts,

I followed the tutorial for Cewolf on the website and was able to display sample charts(with hardcoded values) in a J2ee application.
Now I want to fetch data values from the backend(SAP) and need access to HttpSession in the DataProducer class to be able to connect to SAP.

I understand the DataProducer is being invoked in JSP using the CEWolf tag library.


<jsp:useBean id="pageViews4" class="com.test.model.CeWolfExample"/>
<cewolf:chart
id="verticalbar3d"
title="Consumption History"
type="verticalbar3d"
xaxislabel="Last 12 Months"
yaxislabel="Cost($)"
backgroundcolor="#FFFFFF"
plotbackgroundcolor="#EEFFE0">
<cewolf:data>
<cewolf:producer id="pageViews4"/>
</cewolf:data>
</cewolf:chart>


<cewolf:img chartid="verticalbar3d" renderer="cewolf" width="400" height="300"/>


Is there a way I can send HttpSession from JSP to my DatasetProducer class?
Without the HttpSession, I cannot access the ConnetionManager needed to connect to the backend.

Thanks,
Amandeep
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual approach would be set the pageViews4 object as a request attribute, but I think a session attribute would work just as well.

The HttpSession is accessible in the servlet (or Action class, or wherever you create the DatasetProducer class), so whatever the connection between HttpSession and ConnetionManager is, it should be satisfiable (maybe you can elaborate on that, as I'm not sure I understand).
 
Amandeep Aggarwal
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for a prompt reply. My initial approach to get data from database was incorrect.
After your message I realized that and corrected it. It is working now.

Just a suggestion . Can you add an example like this where consumption values have to be fetched from a datastore and then the graph is generated as a part of your example application for CeWolf.

Thanks again.
Amandeep
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic