tags:

views:

26

answers:

1

Generally the servlet extends httpservlet but in the code below the servlet extends DataSourceServlet and the page is created like this The text begins with google.visualization.Query.setResponse and ends with {c:[{v:'Bob'},{v:'Jane'}]}]}}); on the browser

code: http://code.google.com/apis/visualization/documentation/dev/dsl_csv.html can you please guide me as to how can i make servlet page silent without giving the output on the browser.? so that i can directly call the javascript page for drawing the chart

I want to integrate all the code but i am not able to remove this browser from coming. I am new to servlet please help

A: 

Ok I will explain my doubt again I am writting this servlet code http://code.google.com/apis/visualization/documentation/dev/dsl_csv.html#intro the url to execute is /CsvDataSourceServlet?url=http://localhost:8084/WebApplication1/F2.csv When i execute this code i get output result on my browser ... I am not understanding how that code is opening my browser and showing {c:[{v:'Bob'},{v:'Jane'}]}]}}); etc etc why is this happening , why is the browser opening to show result can we figure out something from this code http://code.google.com/apis/visualization/documentation/dev/dsl_csv.html#intro

were F2.csv is my *.csv file

now after executing the code I have to display the result which i have to do using the javascript code as follows All Examples

// Load the Visualization API and the ready-made Google table visualization. google.load('visualization', '1', {'packages':['annotatedtimeline']}); // Set a callback to run when the API is loaded. google.setOnLoadCallback(init); // Send the queries to the data sources. function init() { //var query = new google.visualization.Query('simpleexample?tq=select name,population'); //query.send(handleSimpleDsResponse); var query = new google.visualization.Query('CsvDataSourceServlet?url=http://localhost:8084/WebApplication1/**F2.csv**'); query.send(handleCsvDsResponse); } // Handle the csv data source query response function handleCsvDsResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('csv_div')); chart.draw(data, {displayAnnotations: true}); }

CSV Data Source

An organization chart. The data is taken from the csv data source.

Akku