Multiple choice technology web technology

What is wrong with the following code? <% if(strPassword.equals("boss")) { } else { } %>

  1. Unmatched bracket in for statement

  2. Flush attribute must be false

  3. Keyword 'file' should be used instead of 'page' in the <jsp:forward/> action

  4. Actions cannot be used within scriptlet blocks

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

JSP actions like are XML-based syntax that must be used outside of scriptlet blocks (<% ... %>). Within scriptlets, you should use programmatic equivalents like response.sendRedirect() or request.getRequestDispatcher().forward(). The syntax shown tries to mix XML action tags inside Java code blocks, which is invalid.