(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 (0.5 point)
Enter a string (str):
Enter an integer (n):
SUB LAST
(When the web page runs, if the interface is not the same as above, 0.5 points will be deducted)
Assume users fill a string for the "str" textfield and an integer for the "n" textfield.
When users click "SUB LAST" button, the browser makes a request to last using Get method (The
Servlet is configured in web.xml) (0.5 point):a. Check validate input n (0 < n < length of string str): If users enter the value of n not satisfied,show the error text "You must input an integer n: 0<n<length of string str." to servlet. (1.0 point)
b. Execute: Cut string str from position n to end of string str, then output the result to servlet (Example: str= "FPT University", n=4 output: "University"). (1.0 point)
Question 2:
Close
+ 100%
Zoom