Index

Logging

dump request names
public static void dumpParams(HttpServletRequest request) {
        Enumeration<String> names = request.getParameterNames();
        System.out.println("# PARAMS#");
        while (names.hasMoreElements()) {
            String name = names.nextElement();
            System.out.println("\t" + name + " => " + request.getParameter(name));
        }
    }
dump request headers
public static void dumpHeaders(HttpServletRequest request) {
        Enumeration<String> names = request.getHeaderNames();
        System.out.println("# HEADERS#");
        while (names.hasMoreElements()) {
            String name = names.nextElement();
            System.out.println("\t" + name + " => " + request.getHeader(name));
        }
    }