Question 1:
(3.0 points)
You are given a NetBeans template project (read more detail in the first page). The given project already
added index.html.
Your tasks:

Edit index.html to create a web page and user can access your page via url /index.html (as Figure
1) (0.5 point)
Enter length:
Enter width:
PERIMETER
Figure 1. Interface of page
(When the web page runs, if the interface is not the same as above, will not be considered for grading)

Assume users fill the values into the textfields (the length and width of the rectangle).
When users click "PERIMETER" button, the browser makes a request to /perimeter using POST
method (The Servlet is configured in web.xml): (0.5 point)
a. Check input length and width: If users enter length/width <1, show the error text "Both length
and width must be an integer number >=1" to servlet. (1.0 point)
b. Execute: Output the perimeter of the rectangle to servlet. (1.0 point)
Question 2:
(3.0 points)
100%