All Downloads are FREE. Search and download functionalities are using the official Maven repository.

webit.script.web.ServletUtil Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
// Copyright (c) 2013, Webit Team. All Rights Reserved.
package webit.script.web;

import java.util.Enumeration;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Zqq
 */
public class ServletUtil {

    @SuppressWarnings("unchecked")
    public static void exportAttributes(final Map map, final HttpServletRequest request) {
        final Enumeration enumeration = request.getAttributeNames();
        String key;
        while (enumeration.hasMoreElements()) {
            map.put(key = enumeration.nextElement(), request.getAttribute(key));
        }
    }

    @SuppressWarnings("unchecked")
    public static void exportParameters(final Map map, final HttpServletRequest request) {
        map.putAll(request.getParameterMap());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy