The specifications do not say how that is suppose to be implemented, but the people writing the code of the servlet-container might do it by using reflection.
This is what is written in the specs (servlet2.4)
doOptions(HttpServletRequest, HttpServletResponse) Called by the server (via the service method) to allow a servlet to handle a
OPTIONS request. The OPTIONS request determines which HTTP methods
the server supports and returns an appropriate header. For example, if a servlet
overrides doGet, this method returns the following header:
Allow: GET, HEAD, TRACE, OPTIONS
There’s no need to override this method unless the servlet implements new
HTTP methods, beyond those implemented by HTTP 1.1.
posted 8 years ago
thanks, so I just rely on the container-implementors that they do it right, no matter how they achieve this (by reflection, etc. ... ).