Slide 24 — the bean example uses three files: this page collects the values, process.jsp copies them into a bean object and prints them, and User.java holds the setter and getter methods.

The code in this page

<form action="process.jsp" method="post">
    Name:    <input type="text" name="name"><br>
    Password:<input type="password" name="password"><br>
    Email:   <input type="text" name="email"><br>
    <input type="submit" value="register">
</form>
Each input name matches the name of a property on the User bean. That is what makes <jsp:setProperty property="*"> possible — the star copies every request parameter into the setter of the same name.

← Back to the example index