Index

HttpServletRequest

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));
        }
    }

sample properties

asyncStarted=false
asyncSupported=false
attributeNames=java.util.Collections$3@3e7a57dd
authType=null
characterEncoding=UTF-8
class=class org.apache.felix.http.base.internal.dispatch.ServletRequestWrapper
contentLength=-1
contentLengthLong=-1
contentType=null
contextPath=
cookies=[Ljavax.servlet.http.Cookie;@498b7bd1
dispatcherType=REQUEST
headerNames=java.util.Collections$3@3c404589
localAddr=127.0.0.1
localName=127.0.0.1
localPort=8000
locale=en_US
locales=java.util.Collections$3@25a30982
method=GET
parameterMap={user=[5141],language=[en]}
parameterNames=java.util.Collections$3@5525b3fe
pathInfo=/some/path
pathTranslated=null
protocol=HTTP/1.1
queryString=user=5141&language=en
reader=org.eclipse.jetty.server.Request$1@a90f286
remoteAddr=127.0.0.1
remoteHost=127.0.0.1
remotePort=48290
remoteUser=null
request=Request(GET //localhost:8000/some/path?user=5141&language=en&)@31498445
requestURI=/some/path
requestURL=http://localhost:8000/some/path
requestedSessionId=node01ivyl62p6outpykqw3enkz1a0.node0
requestedSessionIdFromCookie=true
requestedSessionIdFromURL=false
requestedSessionIdFromUrl=false
requestedSessionIdValid=true
scheme=http
secure=false
serverName=localhost
serverPort=8000
servletContext=org.apache.felix.http.base.internal.whiteboard.PerBundleServletContextImpl@60c92d81
servletPath=
session=org.apache.felix.http.base.internal.handler.HttpSessionWrapper@2435bcb9
userPrincipal=null