I am retrieving the details from the database and printing them in the XML format. It's working pretty good and can even display the same XML format in the Flex. However, I am not sure, how to save this XML file to give it as a data provider for datagrid.
Here is my JSP code :
<%
ps1 = conn.prepareStatement("select file from file where status='P'");
rs1=ps1.executeQuery();
out.println("<?xml version=\"1.0\" enc开发者_运维百科oding=\"UTF-8\"?>");
out.print("<people>" );
while(rs1.next())
{
out.print("<person> " +
"<name>" + rs1.getString(1) +"</name> " +
"</person>") ;
}
out.println("</people>");
%>
It's printing the following details in Flex :
http://localhost:8080/Access/serenity.mp3
I am using the following thing to get the details
event.result.body.people.toXMLString();
Can anyone, pls help me to save the above details in the array collection.
Have you tried using a XMLList instead of an ArrayCollection
?
This article has an example on using XMLList
as a dataProvider
for a DataGrid
as well. I hope this helps!
精彩评论