Web Forms and Form Beans
The login page login.jsp puts up a form for the user to fill out
and submit.
Here is a skeletal look at the
login form in login.jsp
- Note the Struts html:form tag and the html:text tags within its
body
- The render the part of the page that puts up the input fields for the
user to enter
- They name properties of a Javabean that will hold the user name and
password strings entered by the user
- Recall: a Javabean is just a Java
object that follows certain naming conventions
- two fields called userName and password
- access methods are called
getUserName(), setUserName(), getPassword(), and
setPassword()
- Struts calls these beans form beans
- Struts will set the properties of the form bean when the user
submits the form
- How does Struts know which bean the property attribute of the
html:text tag is accessing?