new UrlUtil()
Url工具类
方法列表
| 名称 | 说明 |
|---|---|
| .getArgsFromHref(sHref, sArgName) | 获取通过Url传递的参数 |
| .getContextPath() | 获取根路径 |
| .getRootPathOfWeb() | 获取web路径 2016-7-18 |
| .getUrlArgs() | 获取url上携带的参数 |
详细说明
(static) getArgsFromHref(sHref, sArgName)
获取通过Url传递的参数
参数
| 名称 | 类型 | 缺省值 | 说明 |
|---|---|---|---|
sHref |
String | ||
sArgName |
String |
返回值
param
(static) getContextPath()
获取根路径
返回值
- Type
- string
示例
当前服务地址为:http://localhost:8080/web/frame/frame.jsp时,该方法返回: "/web"
(static) getRootPathOfWeb()
获取web路径 2016-7-18
返回值
String
示例
当前服务地址为:http://localhost:8080/web/frame/frame.jsp时,该方法返回: "http://localhost:8080/web"
(static) getUrlArgs()
获取url上携带的参数
返回值
- Type
- Array
搜索