3 / 67

Q03 - Same POST request parameter behavior

Considering the following HTML form code snippet and the Servlet code, what will be the result of Servlet invocation after the form has been submitted?


<form action="myServlet?var=q1&var=q2" method="POST">
    <input name="var" type="hidden" value="q3" />
    <input type="submit" />


package com.nullhaus;

import javax.servlet.annotation.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class NullServlet extends HttpServlet {
    public void doPost(HttpServletRequest req, HttpServletResponse resp) {
        String[] param = req.getParameterValues("var");