index.jsp
<HTML> <HEAD> <TITLE>Using Password Controls</TITLE> </HEAD> <BODY> <H1>Using Password Controls</H1> <FORM ACTION="basic.jsp" METHOD="POST"> Please enter your password: <INPUT TYPE="PASSWORD" NAME="password"> <BR> <INPUT TYPE="SUBMIT" VALUE="Submit"> </FORM> </BODY> <HTML>
basic.jsp
<HTML> <HEAD> <TITLE>Reading Password Controls</TITLE> </HEAD> <BODY> <H1>Reading Password Controls</H1> <% if(request.getParameter("password").equals("asdf")) { out.println("You're in!"); } else { out.println("I don't think so!"); } %> </BODY> </HTML>