Multiple choice technology web technology

Which of the following EL expression retrieves the value of the attribute by name 'attribute' found in HTTP's request object

  1. ${request.getAttribute()}
  2. ${request.attribute}
  3. ${pageContext.request.getAttribute()}
  4. ${pageContext.request.attribute}
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

EL uses property notation, not method calls. ${pageContext.request.attribute} is correct - it accesses the implicit pageContext object, then its request property, then the attribute property (which maps to getAttribute()).