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


Java RequestUtil.parseParameters方法代码示例

本文整理汇总了Java中org.apache.catalina.util.RequestUtil.parseParameters方法的典型用法代码示例。如果您正苦于以下问题:Java RequestUtil.parseParameters方法的具体用法?Java RequestUtil.parseParameters怎么用?Java RequestUtil.parseParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.util.RequestUtil的用法示例。


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

示例1: mergeParameters

import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
 * Merge the parameters from the saved query parameter string (if any), and
 * the parameters already present on this request (if any), such that the
 * parameter values from the query string show up first if there are
 * duplicate parameter names.
 */
private void mergeParameters() {

    if ((queryParamString == null) || (queryParamString.length() < 1))
        return;

    HashMap<String, String[]> queryParameters = new HashMap<String, String[]>();
    String encoding = getCharacterEncoding();
    if (encoding == null)
        encoding = "ISO-8859-1";
    RequestUtil.parseParameters(queryParameters, queryParamString,
            encoding);
    Iterator<String> keys = parameters.keySet().iterator();
    while (keys.hasNext()) {
        String key = keys.next();
        Object value = queryParameters.get(key);
        if (value == null) {
            queryParameters.put(key, parameters.get(key));
            continue;
        }
        queryParameters.put
            (key, mergeValues(value, parameters.get(key)));
    }
    parameters = queryParameters;

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:32,代码来源:ApplicationHttpRequest.java

示例2: parseStreamParameters

import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
 * Read all parameters directly from the input stream. Necessary because parameters are not mapped to the 
 * HttpRequest.getParameter api on PUT requests
 * @param req
 * @param params
 */
private void parseStreamParameters(HttpServletRequest req, Map<String, List<String>> params) {

	try {
		String content = this.convertStreamToString(req.getInputStream());
		if( content != null && content.length() >= 1 ){
			Map<String, String[]> ps = new HashMap<String, String[]>();
			RequestUtil.parseParameters(ps, content, "UTF-8");
			for (String key : ps.keySet()) {
				List<String> param = new ArrayList<String>();
				for(String value : ps.get(key)) {
					param.add(value);
				}
				params.put(key, param);
			}
		}
	} catch (IOException e) {
		throw new InputException(e);
	}
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:26,代码来源:ParseParametersFilter.java

示例3: mergeParameters

import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
 * Merge the parameters from the saved query parameter string (if any), and
 * the parameters already present on this request (if any), such that the
 * parameter values from the query string show up first if there are
 * duplicate parameter names.
 */
private void mergeParameters() {

    if ((queryParamString == null) || (queryParamString.length() < 1))
        return;

    HashMap queryParameters = new HashMap();
    String encoding = getCharacterEncoding();
    if (encoding == null)
        encoding = "ISO-8859-1";
    try {
        RequestUtil.parseParameters
            (queryParameters, queryParamString, encoding);
    } catch (Exception e) {
        ;
    }
    Iterator keys = parameters.keySet().iterator();
    while (keys.hasNext()) {
        String key = (String) keys.next();
        Object value = queryParameters.get(key);
        if (value == null) {
            queryParameters.put(key, parameters.get(key));
            continue;
        }
        queryParameters.put
            (key, mergeValues(value, parameters.get(key)));
    }
    parameters = queryParameters;

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:36,代码来源:ApplicationHttpRequest.java

示例4: mergeParameters

import org.apache.catalina.util.RequestUtil; //导入方法依赖的package包/类
/**
 * Merge the parameters from the specified query string (if any), and
 * the parameters already present on this request (if any), such that
 * the parameter values from the query string show up first if there are
 * duplicate parameter names.
 *
 * @param queryString The query string containing parameters to be merged
 */
void mergeParameters(String queryString) {

    if ((queryString == null) || (queryString.length() < 1))
        return;

    HashMap queryParameters = new HashMap();
    String encoding = getCharacterEncoding();
    if (encoding == null)
        encoding = "ISO-8859-1";
    try {
        RequestUtil.parseParameters
            (queryParameters, queryString, encoding);
    } catch (Exception e) {
        ;
    }
    synchronized (parameters) {
        Iterator keys = parameters.keySet().iterator();
        while (keys.hasNext()) {
            String key = (String) keys.next();
            Object value = queryParameters.get(key);
            if (value == null) {
                queryParameters.put(key, parameters.get(key));
                continue;
            }
            queryParameters.put
                (key, mergeValues(value, parameters.get(key)));
        }
        parameters = queryParameters;
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:40,代码来源:ApplicationHttpRequest.java


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