@Test public void testDumpRequest() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest("GET", "/main.app"); request.addParameter("choice", "expanded"); request.addParameter("contextMenu", "left"); request.addHeader("header", "headerValue"); request.setCookies(new Cookie("cookie", "yankee dudle")); final String value = HttpUtil.dumpRequest(request); assertTrue(value.contains("choice=expanded")); assertTrue(value.contains("contextMenu=left")); assertTrue(value.contains("header=headerValue")); assertTrue(value.contains("cookie=yankee dudle")); assertEquals("#dumpRequest request is null", HttpUtil.dumpRequest(null)); }
public static String dumpRequest(final HttpServletRequest request) { final StringBuilder stringBuilder = new StringBuilder(); if (request == null) { stringBuilder.append("#dumpRequest request is null"); } else { dumpParamsAndAttrs(request, stringBuilder); dumpHeaders(request, stringBuilder); dumpCookies(request, stringBuilder); } return stringBuilder.toString(); }
HttpUtil { public static String dumpRequest(final HttpServletRequest request) { final StringBuilder stringBuilder = new StringBuilder(); if (request == null) { stringBuilder.append("#dumpRequest request is null"); } else { dumpParamsAndAttrs(request, stringBuilder); dumpHeaders(request, stringBuilder); dumpCookies(request, stringBuilder); } return stringBuilder.toString(); } }
HttpUtil { public static String dumpRequest(final HttpServletRequest request) { final StringBuilder stringBuilder = new StringBuilder(); if (request == null) { stringBuilder.append("#dumpRequest request is null"); } else { dumpParamsAndAttrs(request, stringBuilder); dumpHeaders(request, stringBuilder); dumpCookies(request, stringBuilder); } return stringBuilder.toString(); }  }
HttpUtil { public static String dumpRequest(final HttpServletRequest request) { final StringBuilder stringBuilder = new StringBuilder(); if (request == null) { stringBuilder.append("#dumpRequest request is null"); } else { dumpParamsAndAttrs(request, stringBuilder); dumpHeaders(request, stringBuilder); dumpCookies(request, stringBuilder); } return stringBuilder.toString(); }  static String dumpRequest(final HttpServletRequest request); static String decodeUtf8UriParam(final String value); static String encodeUtf8UriParam(final String value); static Map<String, List<String>> getParameters(final String requestURL,
                                                          final Set<String> pathVariables); static Map<String, List<String>> getParameters(final String requestURL,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static Map<String, List<String>> getParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables); static Map<String, List<String>> getParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static Map<String, List<String>> allParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables); static Map<String, List<String>> allParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static String getSingleValue(final Object param); static String escapeForHTML(final String raw); static String escapeForHTMLAttribute(final String raw); }
HttpUtil { public static String dumpRequest(final HttpServletRequest request) { final StringBuilder stringBuilder = new StringBuilder(); if (request == null) { stringBuilder.append("#dumpRequest request is null"); } else { dumpParamsAndAttrs(request, stringBuilder); dumpHeaders(request, stringBuilder); dumpCookies(request, stringBuilder); } return stringBuilder.toString(); }  static String dumpRequest(final HttpServletRequest request); static String decodeUtf8UriParam(final String value); static String encodeUtf8UriParam(final String value); static Map<String, List<String>> getParameters(final String requestURL,
                                                          final Set<String> pathVariables); static Map<String, List<String>> getParameters(final String requestURL,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static Map<String, List<String>> getParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables); static Map<String, List<String>> getParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static Map<String, List<String>> allParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables); static Map<String, List<String>> allParameters(final HttpServletRequest request,
                                                          final Set<String> pathVariables,
                                                          final boolean removeDuplicates); static String getSingleValue(final Object param); static String escapeForHTML(final String raw); static String escapeForHTMLAttribute(final String raw);  }