标签:res 总结 解析 java.net eth bsp baidu get ethos
解析url
scala> import java.net.URL
import java.net.URL
scala> val urlstr="http://www.baidu.com:8899/getUsername?userid=110&sysId=552"
urlstr: String = http://www.baidu.com:8899/getUsername?userid=110&sysId=552
scala> val aa=new URL(urlstr)
aa: java.net.URL = http://www.baidu.com:8899/getUsername?userid=110&sysId=552
scala> aa.getHost
res262: String = www.baidu.com
scala> aa.getPort
res263: Int = 8899
scala> aa.getPath
res264: String = /getUsername
标签:res 总结 解析 java.net eth bsp baidu get ethos
原文地址:https://www.cnblogs.com/playforever/p/9244684.html