72.7k views
1 vote
Creating an HTML form (doesn't require any JSP knowledge): 25% Create a new file named create.jsp Create an HTTP form that posts to webservices.jsp. (action tag) Create the needed form fields to submit a create request to the webservices.jsp Hint: the form fields need to include: firstName, lastName, employeeNumber, email, and "create". Upload this JSP file with a TXT extension to this assignment in Canvas.

1 Answer

5 votes

Final answer:

To create an HTML form for webservices.jsp, include form fields for firstName, lastName, employeeNumber, email, and a hidden field for the 'create' action.

Step-by-step explanation:

Creating an HTML Form for JSP

To create an HTML form that posts data to webservices.jsp, you'll need to set up the form with the action attribute pointing to the webservices.jsp as shown below:

<form action="webservices.jsp" method="post">
<input type="text" name="firstName" placeholder="First Name" required>
<input type="text" name="lastName" placeholder="Last Name" required>
<input type="text" name="employeeNumber" placeholder="Employee Number" required>
<input type="email" name="email" placeholder="Email" required>
<input type="hidden" name="action" value="create">
<input type="submit" value="Submit">
</form>

The form fields here include input types for firstName, lastName, employeeNumber, and email, with an additional hidden field to define the action as "create". Once filled out, the form data will be sent to webservices.jsp when the user submits the form.

User Randhi Rupesh
by
8.1k points