jsp代码如下:
URL url = new URL("http://xxx.xxx.com/"+Bcode);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
OutputStreamWriter postinfo = new OutputStreamWriter(connection.getOutputStream(), "GB2312");
String sendpara="";
sendpara = "AccCode="+AccCode;
postinfo.write(sendpara);
postinfo.flush();
postinfo.close();
//获取返回数据
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line = null;
while((line = in.readLine()) != null)
{
out.println(line);
}
in.close() ;
这个页面是通过一个url地址获取xml文件,然后在页面上面显示,不过在显示的时候,数据量大的时候会出错,出错的位置大概在7000多行,错误提示是:
结束标记 'Item' 与开始标记 'CallType' 不匹配
但是我把这个程序改成html页面,然后点击按钮提交后,数据就不会出错,请问为什么???
URL url = new URL("http://xxx.xxx.com/"+Bcode);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
OutputStreamWriter postinfo = new OutputStreamWriter(connection.getOutputStream(), "GB2312");
String sendpara="";
sendpara = "AccCode="+AccCode;
postinfo.write(sendpara);
postinfo.flush();
postinfo.close();
//获取返回数据
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line = null;
while((line = in.readLine()) != null)
{
out.println(line);
}
in.close() ;
这个页面是通过一个url地址获取xml文件,然后在页面上面显示,不过在显示的时候,数据量大的时候会出错,出错的位置大概在7000多行,错误提示是:
结束标记 'Item' 与开始标记 'CallType' 不匹配
但是我把这个程序改成html页面,然后点击按钮提交后,数据就不会出错,请问为什么???
应该是你的xml的问题,标记匹配出错
那就说明jsp能正常显示 xml文件的,没有什么限制