Go back to 1Z0-858 - Java Enterprise Edition 5 Web Component Developer Certified Professional Exam

Question :-

Given the JSP code : <%request.setAttribute("foo","bar");%> And the classic tag handler code : Public int doStartTag() throws JspException{ //insert code here //return int } Assume there are no other “foo” attributes in the web application. Which invocation on the pageContext object, inserted at line 6(//insert code here), assigns “bar” to the variable x?
String x = (String) pageContext.getAttribute(“foo”);
String x = (String) pageContext.getRequestScope(“foo”);
It is NOT possible to access the pageContext object from within doStartTag.
String x = (String) pageContext.getRequest().getAttribute(“foo”);
String x = (String) pageContext.getAttribute(“foo”, PageContext.ANY_SCOPE);

Want to practice for 1Z0-858 - Java Enterprise Edition 5 Web Component Developer Certified Professional Exam ? Click here.