public class EchoServlet
extends javax.servlet.http.HttpServlet
doPost()
method also directly returns the input from the sender but writes
the request data also into the log file. Here, the body payload (e.g. XML data) is printed
as well.
Constructor and Description |
---|
EchoServlet()
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Generates the response via HTTP GET.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Generates the response via HTTP POST.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
request
- HTTP requestresponse
- HTTP responsejavax.servlet.ServletException
- Error indicationjava.io.IOException
- Error indicationpublic void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet()
method since the data is also written to the
log file to be able to debug the payload sent by web forms, HTTP POST clients etc. since
these often do not process the response data in an appropriate way.
doPost
in class javax.servlet.http.HttpServlet
request
- HTTP requestresponse
- HTTP responsejavax.servlet.ServletException
- Error indicationjava.io.IOException
- Error indicationCopyright © 2005-2023 Leisenfels GmbH. All rights reserved.