index.jsp
<HTML> <HEAD> <TITLE>Submitting Hidden Fields</TITLE> </HEAD> <BODY> <H1>Submitting Hidden Fields</H1> <FORM ACTION="basic.jsp" METHOD="POST"> <INPUT TYPE="HIDDEN" NAME="HIDDEN" VALUE="Hello from JSP!"> <INPUT TYPE="SUBMIT" VALUE="Submit"> </FORM> </BODY> </HTML>
basic.jsp
<HTML> <HEAD> <TITLE>Reading Hidden Controls</TITLE> </HEAD> <BODY> <H1>Reading Hidden Controls</H1> The hidden text is: <% out.println(request.getParameter("HIDDEN")); %> </BODY> </HTML>