<p style="text-indent: 28px;"><span style="font-family: 宋体; color: rgb(51, 51, 51);"><span style="font-size: 14px; line-height: 28px;"><strong>1.XML文本数据</strong></span></span></p><p><span style="color: rgb(51, 51, 51); font-size: 14px; line-height: 28px; text-indent: 28px; font-family: 宋体;"><%@ page language="java" contentType="text/xml;charset=GBK"%> <!--JSTL标签的引用--></span></p>
<VideoNews>
<c:foreach items = "${videos}" var = "video">
<new id = "${video.id}">
<title>${video.title}</title>
<content>${video.content}</content>
</new>
</c:foreach>
<VideoNews>
在android里面通过Pull解析XML文件(读取流文件)
XmlPullParse pull = Xml.newPullParse();
pull.setInput(inputstream,"utf-8");
2.Json数据
<%@ page language="java" contentType="text/plain;charset=GBK"%> ${json}//text/plain 普通文本文件
在android读取时变成byte[]数组 把他转换成String字符 在通过JsonArray转换成json对象数组。