This question has been asked before on the forum, but I am unable to figure out from that. So, I am passing a form to a servlet,
<form method="Post" action="../JDBCConnector">
<label for="fname">First Name : </label>
<input type="text" name="fname" id="fname">
<label for="lname">Last Name : </label>
<input type="text" name="lname" id="lname">
<label for="uname">Username : </label>
<input type="text" name="uname" id="uname">
<label for="pswrd">Password : </label>
<input type="password" name="pswrd" id="pswrd">
<input type="hidden" name="hide" id="hide" value=1>
<button type="submit" name="submitButton" id="submitButton">Submit </button>
</form>
The servlet side code is,
String name = request.getParameter("hide");
response.getWriter().print(name);
String FNAME = request.getParameter("fname");
response.getWriter().print(FNAME);
The output is
null TestName
Basically, I am getting a null value in the servlet for the hidden field. Can someone please tell what mistake I have made?
Aucun commentaire:
Enregistrer un commentaire