A JSP page named greeting.jsp is passed a parameter in the URL using https://s3a.hivanix.in/quizall/greeting.jsp?name=John. The greeting.jsp contains the following code:
<%@ page language="java" %>
<%
String userName = request.getParameter("name");
String greetingMessage = "Hello, " + userName;
%>
<%= greetingMessage %>
Which of the following statements is true regarding the output of this JSP code?
1
The program gives a syntax error because of the statement <%= greetingMessage %>
2
The program gives a syntax error because of the statement <% String greetingMessage = "Hello, " + userName; %>
3
The program prints "Hello, John"
4
The program gives a syntax error because of the statement <% String userName = request.getParameter(); %>
5
Question Not Attempted