TecH_BoY
10-13-2004, 05:41 AM
Hi pals,
I really need some help here. I am currently creating a Flash generated chart which reads data from a XML file. The data of the XML file can be dynamically changed via a HTML page. This is done using java servlet. So the overall work flow here is.
HTML(jsp) -> Java Servlet -> XML <- Flash
I hope this explains the entire workflow.
Now the problem is, the data updated in XML file doesnt make any changes to the flash chart. I am sure the problem isnt from the flash code, because the chart is updated automatically once i try refreshing the XML page manually via the browser(i open the XML file in browser and hit refresh, pop.... the view of the Flash Chart changes). I doubt the problem is in the Java Servelt code, or the HTML cache. Is there any java code to refresh the updated XML?
Here is my code for the Java Servet:
{
String data[] =request.getParameterValues("data_");
String valu[] =request.getParameterValues("values_");
try
{
Document document = new Document();
PrintWriter out = new PrintWriter( new FileOutputStream("copy_file.xml"));
Element root = document.setRoot("chart"); //XML manipulation
//using some package
for(int k = 0; k < data.length; k++)
{
Element h = root.addElement("chartItem");
h.setAttribute("ChartLabel" , data[k] );
h.setAttribute("ChartValue" , valu[k] );
}
System.out.print(document);
out.print(document);
out.flush();
out.close();
}
catch( Exception exception )
{
System.out.println( "exception: " + exception );
}
}
Note : the data in XML file is changing, but not the view. :confused:
I really need some help here. I am currently creating a Flash generated chart which reads data from a XML file. The data of the XML file can be dynamically changed via a HTML page. This is done using java servlet. So the overall work flow here is.
HTML(jsp) -> Java Servlet -> XML <- Flash
I hope this explains the entire workflow.
Now the problem is, the data updated in XML file doesnt make any changes to the flash chart. I am sure the problem isnt from the flash code, because the chart is updated automatically once i try refreshing the XML page manually via the browser(i open the XML file in browser and hit refresh, pop.... the view of the Flash Chart changes). I doubt the problem is in the Java Servelt code, or the HTML cache. Is there any java code to refresh the updated XML?
Here is my code for the Java Servet:
{
String data[] =request.getParameterValues("data_");
String valu[] =request.getParameterValues("values_");
try
{
Document document = new Document();
PrintWriter out = new PrintWriter( new FileOutputStream("copy_file.xml"));
Element root = document.setRoot("chart"); //XML manipulation
//using some package
for(int k = 0; k < data.length; k++)
{
Element h = root.addElement("chartItem");
h.setAttribute("ChartLabel" , data[k] );
h.setAttribute("ChartValue" , valu[k] );
}
System.out.print(document);
out.print(document);
out.flush();
out.close();
}
catch( Exception exception )
{
System.out.println( "exception: " + exception );
}
}
Note : the data in XML file is changing, but not the view. :confused: