Lab 4-3: HTML Forms
Instructions
- Create an HTML page named lab41.jsp and save it into your projects/public_html directory.
- Add an HTML form to the page. Challenge yourself by trying different types of form fields. Use checkboxes, radio buttons, dropdown to practice using them with a servlet.
- The form’s method should be GET.
- The form’s action should link to a url for a servlet named
java112.project4.Lab41Servlet
. - Add a few input fields to the form. These should include a text field, and any other input type you would like.
- Create a servlet named
Lab41Servlet
and place it in thejava112.project4
package. - The servlet should extract the parameters from the HTML form and save them to the request object.
- Output the form entries to the lab41.jsp.
Hint
To display the form fields ONLY when they have been entered by the user you will need to use JSTL and EL.
Screenshots
To receive credit for this lab save a screenshot in the projects/screenshots/week14
directory.
lab3-form.png
: The results of your form submission in the browser.
Add, commit, and push and verify all work, including screenshots are visible in GitHub.
Rubric
All of the following must be satisfied to achieve a "Met" status
- Screenshot clearly shows the results the form submission in the browser.
- Code and screenshots are properly named and saved in the correct directory.
- All lab steps have been accurately and appropriately implemented.
- Code adheres to the course coding standards.
- Commit messages are concise, atomic, and effectively describe the change(s) made.
- JavaDoc documentation is properly implemented, providing clarity and understanding of the code's functionality and usage.
- External sources (websites, classmates, AI tools, etc), if utilized, are referenced and documented within the code as comments.
Additional Considerations
- The correct path for the form's
action
is used. - Multiple types of form fields are used.
- Form entries are displayed on the JSP with JSTL and EL.
- Form entries are only visible on the JSP after they have been submitted.