java怎么获取远程带参数的xml文件?
类似地址:
http://192.168.1.100/test.jsp?cindex=2&pagesize=2
如果没有带有参数的地址:像
http://192.168.1.100/test.xml就能获取。
[quote]您能说再详细点吗。。。非常感谢!!![/quote]
你传参数的目的是什么? 如果用户传了参数,返回给用户的xml和test.xml有什么关系吗?
[quote]http://192.168.1.100/test.jsp?cindex=2&pagesize=2 [/quote]
既然传参数,就需要做相应的处理,需要在servlet中进行处理,步骤:
1 设置响应头,把Content-Type设置成application/xml
2 把xml文件写到输出流并返回