Multiple choice technology architecture

Which of the following statements are true?

  1. HttpServletRequest getParameter(...) retrieves the parameter value from the request

  2. HttpServletResponse getAttribute(...) retrieves the attribute value from the response

  3. HttpServletResponse getParameter(...) retrieves the parameter value from the response

  4. HttpServletRequest setParameter(...) sets the parameter value to the request

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

HttpServletRequest.getParameter() retrieves request parameters (form data, query string parameters) from the client. HttpServletResponse does not have a getParameter() method as parameters are only in requests. There is no setParameter() method in HttpServletRequest - parameters are read-only once set. HttpServletResponse.getAttribute() doesn't exist - attributes are on requests, not responses.