Q:

request.getParameter() returns null after submitting the form

I dont know whats wrong!  
filename: test2.html
<html>
<body>
    <form  id="n1" method="POST" action="alter.jsp" />
    <input id="iditem" type="hidden"  value="213" />
    <input id="name1" type="hidden" value="123" />
    <input type="submit" value="test"/>
</body>
</html>

filename: alter.jsp
<%@ page import ="java.sql.*" %>
<%
String itemid = request.getParameter("iditem");
String name1 = request.getParameter("name1");
%>
<html><body>test<%= itemid %> + <%= name1 %></body></html>

after submitting the form the 2nd page only shows "test null null"

A:

The parameter name is set using the name attribute. Your form controls don't have names so they won't be successful (i.e. won't submit any data).
The id attribute is used for client side operations such as:

Linking to with a fragment identifier
Associating a <label> with a form control
Targeting using CSS
Selecting using JavaScript and DOM

