Multiple choice technology web technology

What is the equivalent action code for the following piece of JSP code snippet? EmployeeBean harry = (EmployeeBean)request.getAttribute("harry"); if (harry == null) { harry = new EmployeeBean(); request.setAttribute("harry", harry); }

  1. <jsp:declareBean id = "harry" class = "EmployeeBean" scope = "request" />

  2. <jsp:createBean id = "harry" class = "EmployeeBean" />

  3. <jsp:useBean id = "harry" class = "EmployeeBean" scope = "request" />

  4. <jsp:useBean id = "harry" class = "EmployeeBean" />

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

The action with scope="request" creates or retrieves a bean from request scope exactly as the Java code does - if null, it instantiates and stores it. Option D is incomplete (missing scope).