Multiple choice technology web technology

What method can be used to retrieve all the parameter names being sent as part of the request by the client?

  1. Use the method 'HttpServletRequest.getParameterNames()' which will return an enumeration of parameter names.

  2. Use the method 'HttpServletResponse.getParameterNames()' which will return an enumeration of parameter names.

  3. Use the method 'HttpServletRequest.getAllParameters()' which will return an enumeration of parameter names.

  4. There is no direct support in the Servlet API to retrieve the name of all the parameters sent by the client.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Servlet API provides getParameterNames() method in HttpServletRequest to retrieve all parameter names sent by the client. This returns an Enumeration of String objects representing parameter names. HttpServletResponse is for sending responses, not reading request parameters. There is no getAllParameters() method.