高分求教,Applet如何访问远端资源啊(访问xml文件)
想Applet读取服务器的xml文件,文件地址为http://localhost/a/tree.xml,用ie能打开浏览这个文件了。
现在想在Applet中访问改文件,我用jdom来对xml文件进行操作的。如下几行代码,总是出错。
SAXBuilder sb=new SAXBuilder();
URL url=new URL("http://localhost/a/tree.xml");
Document doc = sb.build(url);
Element root=doc.getRootElement();
......
出错信息为
java.io.IOException: Server returned HTTP response code: 401 for URL:http://localhost/a/tree.xml
哪位大侠帮帮忙啊。。。。。。。。。。