Read Form Password Field : Form Password « JSP « Java Tutorial






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>
  Download:  ReadFormPasswordField.zip( 1 k)








23.21.Form Password
23.21.1.Read Form Password Field