当前位置: 首页>>代码示例>>Java>>正文


Java ParamUtil类代码示例

本文整理汇总了Java中com.feilong.core.net.ParamUtil的典型用法代码示例。如果您正苦于以下问题:Java ParamUtil类的具体用法?Java ParamUtil怎么用?Java ParamUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ParamUtil类属于com.feilong.core.net包,在下文中一共展示了ParamUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQueryStringLog

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * 获取queryString (支持 post/get).
 *
 * @return the query string
 * @see javax.servlet.http.HttpServletRequest#getMethod()
 */
private String getQueryStringLog(){
    // Returns the name of the HTTP method with which this request was made,
    // for example, GET, POST, or PUT.
    // Same as the value of the CGI variable REQUEST_METHOD.
    String method = request.getMethod();

    if ("post".equalsIgnoreCase(method)){
        Map<String, String[]> map = RequestUtil.getParameterMap(request);
        if (isNotNullOrEmpty(map)){
            return ParamUtil.toQueryStringUseArrayValueMap(map);
        }
    }
    // Returns the query string that is contained in the request URL after the path.
    // This method returns null if the URL does not have a query string.
    // Same as the value of the CGI variable QUERY_STRING.
    // 它只对get方法得到的数据有效.
    return request.getQueryString();
}
 
开发者ID:venusdrogon,项目名称:feilong-servlet,代码行数:25,代码来源:RequestLogBuilder.java

示例2: toNavigationPageNumberMap

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * 转成导航页码的map.
 *
 * @param dynamicNavigationPageNumberConfig
 *            the dynamic navigation page number config
 * @return the map
 */
private static Map<Integer, Integer> toNavigationPageNumberMap(String dynamicNavigationPageNumberConfig){
    // 1 将字符串转成 map Map<String, String>
    Map<String, String> singleValueMap = ParamUtil.toSingleValueMap(dynamicNavigationPageNumberConfig, UTF8);

    // 2 转成 Map<Integer, Integer>
    Map<Integer, Integer> integerMap = toMap(singleValueMap, Integer.class, Integer.class);

    //3  排序
    return sortMapByKeyDesc(integerMap);
}
 
开发者ID:venusdrogon,项目名称:feilong-taglib,代码行数:18,代码来源:PagerCacheContentBuilder.java

示例3: testJoinSingleValueMap2

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join single value map 2.
 */
@Test
public void testJoinSingleValueMap2(){
    Map<String, String> map = newLinkedHashMap();
    map.put(null, null);
    map.put("a", "");
    map.put("b", null);
    map.put("c", "jim");

    assertEquals("=&a=&b=&c=jim", ParamUtil.toQueryStringUseSingleValueMap(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:14,代码来源:ToQueryStringUseSingleValueMapTest.java

示例4: testJoinSingleValueMap1

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join single value map1.
 */
@Test
public void testJoinSingleValueMap1(){
    Map<String, String> singleValueMap = newLinkedHashMap();

    singleValueMap.put("province", "江苏省");
    singleValueMap.put("city", "南通市");

    assertEquals("province=江苏省&city=南通市", ParamUtil.toQueryStringUseSingleValueMap(singleValueMap));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToQueryStringUseSingleValueMapTest.java

示例5: testToNaturalOrderingString

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test to natural ordering string.
 */
@Test
public void testToNaturalOrderingString(){
    Map<String, String> map = newHashMap();
    map.put("service", "create_salesorder");
    map.put("_input_charset", "gbk");
    map.put("totalActual", "210.00");
    map.put("address", "江苏南通市通州区888组888号");

    assertEquals(
                    "_input_charset=gbk&address=江苏南通市通州区888组888号&service=create_salesorder&totalActual=210.00",
                    ParamUtil.toNaturalOrderingQueryString(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:16,代码来源:ToNaturalOrderingQueryStringTest.java

示例6: testToNaturalOrderingStringNullValue

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test to natural ordering string 3.
 */
@Test
public void testToNaturalOrderingStringNullValue(){
    Map<String, String> map = newHashMap();
    map.put("service", null);
    map.put("totalActual", "210.00");
    map.put("province", "江苏省");
    assertEquals("province=江苏省&service=&totalActual=210.00", ParamUtil.toNaturalOrderingQueryString(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:12,代码来源:ToNaturalOrderingQueryStringTest.java

示例7: testToNaturalOrderingStringNullKey

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test to natural ordering string null key.
 */
@Test
public void testToNaturalOrderingStringNullKey(){
    Map<String, String> map = newHashMap();
    map.put("totalActual", null);
    map.put(null, "create_salesorder");
    map.put("province", "江苏省");
    assertEquals("=create_salesorder&province=江苏省&totalActual=", ParamUtil.toNaturalOrderingQueryString(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:12,代码来源:ToNaturalOrderingQueryStringTest.java

示例8: testJoinValuesTwoKeys

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join values two keys.
 */
@Test
public void testJoinValuesTwoKeys(){
    Map<String, String> map = toMap("service", "create_salesorder", "paymentType", "unionpay_mobile");
    assertEquals("create_salesorder" + "unionpay_mobile", ParamUtil.joinValuesOrderByIncludeKeys(map, "service", "paymentType"));
    assertEquals("unionpay_mobile" + "create_salesorder", ParamUtil.joinValuesOrderByIncludeKeys(map, "paymentType", "service"));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:10,代码来源:JoinValuesOrderByIncludeKeysTest.java

示例9: testJoinArrayValueMap

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join array value map.
 */
@Test
public void testJoinArrayValueMap(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", new String[] { "江苏省", "浙江省" });
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=江苏省&province=浙江省&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToQueryStringUseArrayValueMapTest.java

示例10: testJoinArrayValueMapNullElement

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join array value map null element.
 */
@Test
public void testJoinArrayValueMapNullElement(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", new String[] { "江苏省", null });
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=江苏省&province=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToQueryStringUseArrayValueMapTest.java

示例11: testJoinArrayValueMapNullValue

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join array value map null value.
 */
@Test
public void testJoinArrayValueMapNullValue(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", null);
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToQueryStringUseArrayValueMapTest.java

示例12: testJoinArrayValueMapNullParamAndNullValue

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
/**
 * Test join array value map null param and null value.
 */
@Test
public void testJoinArrayValueMapNullParamAndNullValue(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put(null, null);
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToQueryStringUseArrayValueMapTest.java

示例13: testToNaturalOrderingKeyJoinValue

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
@Test
public void testToNaturalOrderingKeyJoinValue(){
    Map<String, String> map = newHashMap();
    map.put("service", "create_salesorder");
    map.put("_input_charset", "gbk");
    map.put("totalActual", "210.00");
    map.put("address", "江苏南通市通州区888组888号");

    assertEquals(
                    "_input_charsetgbkaddress江苏南通市通州区888组888号servicecreate_salesordertotalActual210.00",
                    ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:13,代码来源:ToNaturalOrderingKeyJoinValueTest.java

示例14: testToNaturalOrderingKeyJoinValueNullValue

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
@Test
public void testToNaturalOrderingKeyJoinValueNullValue(){
    Map<String, String> map = newHashMap();
    map.put("service", null);
    map.put("totalActual", "210.00");
    map.put("province", "江苏省");
    assertEquals("province江苏省servicetotalActual210.00", ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:9,代码来源:ToNaturalOrderingKeyJoinValueTest.java

示例15: testToNaturalOrderingKeyJoinValueNullKey

import com.feilong.core.net.ParamUtil; //导入依赖的package包/类
@Test
public void testToNaturalOrderingKeyJoinValueNullKey(){
    Map<String, String> map = newHashMap();
    map.put("totalActual", null);
    map.put(null, "create_salesorder");
    map.put("province", "江苏省");
    assertEquals("create_salesorderprovince江苏省totalActual", ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
开发者ID:venusdrogon,项目名称:feilong-core,代码行数:9,代码来源:ToNaturalOrderingKeyJoinValueTest.java


注:本文中的com.feilong.core.net.ParamUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。