Multiple choice technology programming languages

Given the JSP code: <% request.setAttribute("foo", "bar"); %> and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContext object, inserted at line 6, assigns "bar" to the variable x?

  1. String x = (String) pageContext.getAttribute("foo");

  2. String x = (String) pageContext.getRequestScope("foo");

  3. It is NOT possible to access the pageContext object from within doStartTag.

  4. String x = (String)

Reveal answer Fill a bubble to check yourself
D Correct answer