permaculture playing cards
The moose likes Other Open Source Projects and the fly likes CeWolf - Send HttpSession to DataProducer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "CeWolf - Send HttpSession to DataProducer" Watch "CeWolf - Send HttpSession to DataProducer" New topic

CeWolf - Send HttpSession to DataProducer

Amandeep Aggarwal

Joined: Jul 11, 2008
Posts: 12
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"/>
title="Consumption History"
xaxislabel="Last 12 Months"
<cewolf:producer id="pageViews4"/>

<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.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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

Joined: Jul 11, 2008
Posts: 12
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.
I agree. Here's the link:
subject: CeWolf - Send HttpSession to DataProducer
It's not a secret anymore!