[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

HELP!!! Urgent .. Inner class error in jsp

Asked by zamirjalil in Java Server Pages (JSP)

Tags: cewolf, inner

Hello experts out there,

I try to generate line graph based on cewolf open source graph software.
What I want to do is I want to get some data from 'GraphByFruit' class that passed in object of array. This object is stored in a session attribute "GraphData".

My below code produce error msg : "local variable request is accessed from within inner class; needs to be declared final"

How should I get the value from "GraphByFruits" class??
pls help...


my code in jsp:

        DatasetProducer categoryData = new DatasetProducer() {
          HttpSession logSession = request.getSession(false);
                public Object produceDataset(Map params) {
                         GraphByFruit[] graph = (GraphByFruit[])session.getAttribute("GraphData");
                          String state = "";
                          String fruit = "";
                          float[] qty = null;
                          final String[] arrayOfFruit = new String[graph.length];
                          System.out.print("arrayOfFruit ="+arrayOfFruit.length+"\n");
                          final String[] categories= { "a", "s", "d", "f", "g", "h", "j", "k", "r"};

                          for (int i=0; i < graph.length; i++) {
                                    state=graph[i].getStateID();
                                    qty = graph[i].getProdQty();
                                    fruit = ""+graph[i].getFruitID();
                                    if (i<graph.length-1) fruit = fruit+",";
                                    arrayOfFruit [i] = fruit;
                          }

                        //final String[] categories = { "apples", "pies", "bananas", "oranges" };
                        //final String[] seriesNames = { "Peter", "Helga", "Franz", "Olga" };

                        final Integer[][] startValues = new Integer[arrayOfFruit.length][categories.length];
                        final Integer[][] endValues = new Integer[arrayOfFruit.length][categories.length];
                        for (int series = 0; series < arrayOfFruit.length; series++) {
                                for (int i = 0; i < categories.length; i++) {
                                        int y =0;
                                        startValues[series][i] = new Integer(y);
                                        endValues[series][i] = new Integer(y + (int) (Math.random() * 10));
                                }
                        }
                        DefaultIntervalCategoryDataset ds =
                                new DefaultIntervalCategoryDataset(seriesNames, categories, startValues, endValues);
                        return ds;
                }
                public String getProducerId() {
                        return "CategoryDataProducer";
                }
                public boolean hasExpired(Map params, Date since) {
                        return false;
                }
        };
        pageContext.setAttribute("categoryData", categoryData);
%>

<html>
<head>
<link href="cewolf.css" rel="stylesheet" type="text/css"></head>
<BODY bgcolor="#DDE8F2">
<H1>Cewolf Chart Set</H1>
<p>

<cewolf:chart id="lineChart" title="LineChart" type="line" xaxislabel="Fruit" yaxislabel="favorite">
    <cewolf:data>
        <cewolf:producer id="categoryData" />
    </cewolf:data>
</cewolf:chart>
<cewolf:img chartid="lineChart" renderer="cewolf" width="300" height="300"/>
</body>
</html>
[+][-]04/26/04 12:17 AM, ID: 10916072Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java Server Pages (JSP)
Tags: cewolf, inner
Sign Up Now!
Solution Provided By: TimYates
Participating Experts: 2
Solution Grade: A
 
[+][-]04/26/04 12:18 AM, ID: 10916077Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 12:59 AM, ID: 10916269Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 01:03 AM, ID: 10916295Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 01:05 AM, ID: 10916308Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 01:08 AM, ID: 10916322Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 01:17 AM, ID: 10916376Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 01:20 AM, ID: 10916390Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 01:27 AM, ID: 10916430Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 01:31 AM, ID: 10916458Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 01:36 AM, ID: 10916483Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 01:36 AM, ID: 10916484Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 01:45 AM, ID: 10916551Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/04 02:26 AM, ID: 10916751Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 11:35 PM, ID: 10925744Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/04 11:38 PM, ID: 10925759Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/04 01:00 AM, ID: 10926236Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/27/04 01:02 AM, ID: 10926248Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93