SCJP Certification

Sun Certified Java Programmer Certification exam essentials

April 23rd, 2010

What is the doTrace() method?

SCWCD, by Daisy Williams.

The doTrace() method allows a servlet to handle a TRACE request. It is called by the server via the service method. If the headers sent with the TRACE request, a TRACE is always returned to the client, so that they can be used in debugging. There’s no need to override this method. The following is the general format of the doTrace() method:

protected void doTrace(HttpServletRequest rq1, HttpServletResponse rsp1) throws ServletException, java.io.IOException

Here the parameter, rq1 is the HttpServletRequest object that contains the request the client made to the servlet. The parameter rsp1 is the HttpServletResponse object that contains the response the servlet returns to the client. This method will throw java.io.IOException if an input or output error occurs while the servlet is handling the TRACE request. If the request for the TRACE cannot be handled, it will throw the ServletException exception.

Share

Back Top

Responses to “What is the doTrace() method?”

Comments (0) Trackbacks (0) Leave a comment Trackback url
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*