无法保存以 XML 格式打印的 JSP 数据?
我正在从数据库中检索详细信息并以 XML 格式打印它们。它工作得很好,甚至可以在 Flex 中显示相同的 XML 格式。但是,我不确定如何保存此 XML 文件以将其作为数据网格的数据提供程序。
这是我的 JSP 代码:
<%
ps1 = conn.prepareStatement("select file from file where status='P'");
rs1=ps1.executeQuery();
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
out.print("<people>" );
while(rs1.next())
{
out.print("<person> " +
"<name>" + rs1.getString(1) +"</name> " +
"</person>") ;
}
out.println("</people>");
%>
它在 Flex 中打印以下详细信息:
http://localhost:8080/Access/serenity.mp3
我正在使用以下内容来获取详细信息
event.result.body.people.toXMLString();
任何人都可以帮助我将上述详细信息保存在数组集合中。
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\" encoding=\"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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用 XMLList 而不是
ArrayCollection?
本文有一个使用<的示例code>XMLList 也作为
DataGrid
的dataProvider
。我希望这有帮助!Have you tried using a XMLList instead of an
ArrayCollection
?This article has an example on using
XMLList
as adataProvider
for aDataGrid
as well. I hope this helps!