@@ -0,0 +1,1609 @@
+package de.asw.courses.web2016.demo.backend.servlet.introspect;%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport java.util.Arrays;%0Aimport java.util.Collections;%0Aimport java.util.Scanner;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A@WebServlet(%22/introspect/*%22)%0Apublic class HttpRequestIntrospectionServlet extends HttpServlet %7B%0A%0A%09@Override%0A%09protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException %7B%0A%0A%09%09String httpMethod = req.getMethod();%0A%09%09String requestUri = req.getRequestURI();%0A%0A%09%09String queryString = req.getQueryString();%0A%0A%09%09PrintWriter out = resp.getWriter();%0A%0A%09%09out.println(%22Request%22);%0A%09%09out.printf(%22%25s %25s?%25s%25n%22, httpMethod, requestUri, queryString);%0A%09%09out.println();%0A%0A%09%09out.println(%22Headers%22);%0A%09%09for (String headerName : Collections.list(req.getHeaderNames())) %7B%0A%09%09%09String headerValue = req.getHeader(headerName);%0A%09%09%09out.printf(%22%25s %25s%25n%22, headerName, headerValue);%0A%09%09%7D%0A%09%09out.println();%0A%0A%09%09out.println(%22Parameters%22);%0A%09%09for (String parameterName : Collections.list(req.getParameterNames())) %7B // req.getParameterMap()%0A%09%09%09String parameterValue = Arrays.toString(req.getParameterValues(parameterName));%0A%09%09%09out.printf(%22%25s %25s%25n%22, parameterName, parameterValue);%0A%09%09%7D%0A%09%09out.println();%0A%0A%09%09out.println(%22Request Body%22);%0A%09%09try (Scanner scanner = new Scanner(req.getReader())) %7B%0A%09%09%09while (scanner.hasNextLine()) %7B%0A%09%09%09%09System.out.println(scanner.nextLine());%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add example for http servlet request introspection