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

In EL (Expression Language), request attributes are accessed via ${pageContext.request.attributeName}. The pageContext implicit object provides access to request attributes. Options A and C incorrectly use getAttribute() syntax, and B accesses a non-existent 'attribute' property directly on request.