I am using google visualization API in JSF 2.0 application. I have made a 
SqlDataSourceServlet which retrieves data from the remote database (Oracle 
11g). But this servlet does not getting called, instead it gives the 
following error on the error console. 

Error: google.visualization.Query: Not Found [404] Source File: 

Here is my code for Javascript calling the servlet :

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" 
src="https://www.google.com/jsapi";></script>
      <script type="text/javascript">
      Array.prototype.reduce = undefined;
    </script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1', {'packages':['table']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(init);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function init() {

          var query = new 
google.visualization.Query('SqlDataSourceServlet');
            query.send(handleQueryResponse);
      }
      
       // Handle the query response.
      function handleQueryResponse(response) {
        if (response.isError()) {
          alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());
          return;
        }
        
       // Draw the visualization.
          var data = response.getDataTable();
          var chart = new 
google.visualization.Table(document.getElementById('chart_div'));
          chart.draw(data, {width: 600, height: 150, is3D: true});
        }
      
    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div"></div>
  </body>
</html>

The servlet mapping has also been correctly defined in web.xml. 
Please help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to