URI抛出URISyntaxException异常处理

在用new URI(String url)处理url时抛出URISyntaxException异常处理
java.net.URISyntaxException: Malformed escape pair at index 113: http://www.zuoche.com/pda/showmap.jsp?f=1&s=5508107&d=5511127&xy=32786,2559633,35024,2560043&k=fd120733&m=1&tt=1.%u4F53%u80B2%u4E2D%u5FC3%u7AD9%u2192%u534E%u5E08&ref=tid%3D4463987%2Ce9eb5f7e%26d%3D%25BB%25AA%25CA%25A6%26sid%3D5506916%2C659678f0%26m%3D1
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.scanEscape(Unknown Source)
at java.net.URI$Parser.scan(Unknown Source)
at java.net.URI$Parser.checkChars(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.(Unknown Source)


解决办法是用new URL(String url)代替new URI(String url),它们具有同等效果。
文档说明:http://www.kuqin.com/J2SE6-API/java/net/URI.html

你可能感兴趣的:(J2SE)