SCJP Certification

Sun Certified Java Programmer Certification exam essentials

April 22nd, 2010

What is the doOptions() method?

SCWCD, by Daisy Williams.

The doOptions() method is called by the server via the service method. It allows a servlet to handle a OPTIONS request. The OPTIONS request determines which HTTP methods the server supports and returns an appropriate header. The following is the general form of this method:

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

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

Share

Back Top

Responses to “What is the doOptions() 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 *

*