In the servlet I am trying to get the value of the submit button in the form below using
Servlet code:
String addGifts = request.getParameter("addGifts");
This code gives me attribute addGifts as null. The form is below. The value of temp.get(0) is a (Long) Object.
JSP form:
<%
    int i = gifts.size();
    System.out.println("gifts.size() = " + i);
    int j = 0;
    while (j < i) {
        ArrayList temp = new ArrayList();
        temp = gifts.get(j);
        System.out.println("Gift Id: " + temp.get(0));
        out.println("<tr>");
        out.println("<td>" + temp.get(1) + "</td>");
        out.println("<td>" + temp.get(2) + "</td>");
        out.println("<td>" + temp.get(3) + "</td>");
        out.println("<td><form method=\"POST\" action=\"gift-add\">");
        out.println("<button type=\"submit\" name=\"addgift\" value=\"" + temp.get(0) + "\">Redemm</button>");
        out.println("</form></td>");
        out.println("</tr>");
        j++;
    }
    //System.out.println("<input class=\"text\" value=\"Enter Page\">");
%>
Any ideas why the attribute addGifts is null?
 
     
     
     
     
    