Class HttpEchoServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.devonfw.module.web.common.base.debug.HttpEchoServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class HttpEchoServlet extends javax.servlet.http.HttpServletAnHttpServletto echo theHttpServletRequestwith headers and payload as HTML output in theHttpServletResponse. This is very helpful especially if your application is behind a complex infrastructure with reverse-proxies, etc.
In order to use this servlet simply add the following to your spring configuration (and adjust "/debug/echo/*" to your needs):@Bean public ServletRegistrationBean echoServletRegistration() { HttpEchoServlet echoServlet = new HttpEchoServlet(); ServletRegistrationBean registration = new ServletRegistrationBean(echoServlet); registration.addUrlMappings("/debug/echo/*"); return registration; }- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCOOKIE_SECUREDprivate static StringSECUREDprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description HttpEchoServlet()Der Konstruktor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringgetSecuredValue(String originalHeaderName, String value)private voidprintHeaders(javax.servlet.http.HttpServletRequest request, PrintWriter out)protected voidservice(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
SECURED
private static final String SECURED
- See Also:
- Constant Field Values
-
COOKIE_SECURED
private static final String COOKIE_SECURED
- See Also:
- Constant Field Values
-
-
Method Detail
-
service
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
printHeaders
private void printHeaders(javax.servlet.http.HttpServletRequest request, PrintWriter out)
-
-