當我運行下面的代碼塊:接收java.net.MalformedURLException
try {
URL surl = new URL("http://w3devadv.liveproj.com/api/apiRequest.php?Method=getdealdetails&DealId=2&SessionId=EA3JQ0RZJT4e66223143fc5");
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp1 = spf.newSAXParser();
XMLReader xr = sp1.getXMLReader();
DealdetailsHandler dh = new DealdetailsHandler();
xr.setContentHandler(dh);
xr.parse(new InputSource(surl.openStream()));
} catch (MalformedURLException mue) {
mue.printstacktrace();
}
我收到此錯誤:
Exc = java.net.MalformedURLException
任何人都可以指出我在做什麼錯?
嘗試加載在PC瀏覽器的網址是什麼?它迴應? –
代碼似乎對我來說,你確定這個異常來源於這裏嗎? – Caner
該網址在瀏覽器中正常工作,但該例外僅源於此處。 – Harish