@Test public void testGetUrlParam() { assertEquals("value", UrlUtil.getURLParam("http: assertEquals("value", UrlUtil.getURLParam("http: assertEquals("value", UrlUtil.getURLParam("http: }
public static String getURLParam(String url, String paramName) { String strReturn = ""; String strHref = url; if (strHref.indexOf("?") > -1) { String strQueryString = strHref.substring(strHref.indexOf("?")); String[] aQueryString = strQueryString.split("&"); for (int iParam = 0; iParam < aQueryString.length; iParam++) { if (aQueryString[iParam].indexOf(paramName + "=") > -1) { String[] aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; strReturn = strReturn.split("#")[0]; break; } } } return strReturn; }
UrlUtil { public static String getURLParam(String url, String paramName) { String strReturn = ""; String strHref = url; if (strHref.indexOf("?") > -1) { String strQueryString = strHref.substring(strHref.indexOf("?")); String[] aQueryString = strQueryString.split("&"); for (int iParam = 0; iParam < aQueryString.length; iParam++) { if (aQueryString[iParam].indexOf(paramName + "=") > -1) { String[] aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; strReturn = strReturn.split("#")[0]; break; } } } return strReturn; } }
UrlUtil { public static String getURLParam(String url, String paramName) { String strReturn = ""; String strHref = url; if (strHref.indexOf("?") > -1) { String strQueryString = strHref.substring(strHref.indexOf("?")); String[] aQueryString = strQueryString.split("&"); for (int iParam = 0; iParam < aQueryString.length; iParam++) { if (aQueryString[iParam].indexOf(paramName + "=") > -1) { String[] aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; strReturn = strReturn.split("#")[0]; break; } } } return strReturn; } private  UrlUtil(); }
UrlUtil { public static String getURLParam(String url, String paramName) { String strReturn = ""; String strHref = url; if (strHref.indexOf("?") > -1) { String strQueryString = strHref.substring(strHref.indexOf("?")); String[] aQueryString = strQueryString.split("&"); for (int iParam = 0; iParam < aQueryString.length; iParam++) { if (aQueryString[iParam].indexOf(paramName + "=") > -1) { String[] aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; strReturn = strReturn.split("#")[0]; break; } } } return strReturn; } private  UrlUtil(); static boolean hasProtocol(String url); static String ensureProtocol(String url, String protocol); static String ensureProtocol(String url); static String getHostname(String url); static String getRefererURI(HttpServletRequest request); static String getProtocol(String url); static String getAbsoluteUrl(String url, String src); static String getURLParam(String url, String paramName); static InetAddress convertIPString(String IPString); static List<String> getEndPoints(); }
UrlUtil { public static String getURLParam(String url, String paramName) { String strReturn = ""; String strHref = url; if (strHref.indexOf("?") > -1) { String strQueryString = strHref.substring(strHref.indexOf("?")); String[] aQueryString = strQueryString.split("&"); for (int iParam = 0; iParam < aQueryString.length; iParam++) { if (aQueryString[iParam].indexOf(paramName + "=") > -1) { String[] aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; strReturn = strReturn.split("#")[0]; break; } } } return strReturn; } private  UrlUtil(); static boolean hasProtocol(String url); static String ensureProtocol(String url, String protocol); static String ensureProtocol(String url); static String getHostname(String url); static String getRefererURI(HttpServletRequest request); static String getProtocol(String url); static String getAbsoluteUrl(String url, String src); static String getURLParam(String url, String paramName); static InetAddress convertIPString(String IPString); static List<String> getEndPoints();  }