Your tasks:
Edit index.html to create a web page and user can access your page via url/index.html (0.5 point)
Enter an integer array:
Choose an option:
SUM
O Odd Even
Zoom
(When the web page runs, if the interface is not the same as above, 0.5 points will be deducted)
Assume users fill the value for an array into the textfield, each element is separated by a comma "," (called a).
When users click "SUM" button, the browser makes a request to /sum using Get method (TheServlet is configured in web.xml) (0.5 point):
a. Check validate input a: If users enter all elements of array that are not integer numbers > 0,show the error text "You must input an integer array" to servlet. (1.0 point)
b. Execute:
- If users choose "Odd" option, calculate the sum of the elements in the array that are odd integer numbers, then output the result to servlet (Example: a=1,2,3,4,5 output: 9). (0.5 point)
If users choose "Even" option, calculate the sum of the elements in the array that are even integer numbers, then output the result to servlet (Example: a=1,2,3,4,5 output: 6). (0.5 point)
Question 2:
(3.0 points)
You are given a NetBeans template project (read more detail in the first page).
Your tasks
Add MyExecution.jsp and start running from this page (The user can access your page via url / MyExecution.jsp): (0.5 point)
Enter an integer array:
Choose an option:Odd Even
Result:
COUNT
List of Executions
+ 100%
Close