Question
Can anyone help me with this? I am stuck. Instructions: Create a NetBeans Web project to demonstrate the use of HTML Form and JavaServer Pages.
Can anyone help me with this? I am stuck.
Instructions: Create a NetBeans Web project to demonstrate the use of HTML Form and JavaServer Pages. You can apply some CSS styles as you see fit.
1. Create an html page1 that functions as the interface of a Web calculator. It should include:
A heading
A form with two text inputs, four submit buttons (representing four math operators), and a reset button that can clear user inputs
A table that holds form inputs
Athat is used to display the result processed by the corresponding JSP for the form. Learn the
2. Create a JSP page that processes the Form in page1.
Depending on the operator button clicked by the user, the JSP should process user inputs, calculate and display the result in the iframe at the bottom of page1 as shown in the sample screenshot 1.
The JSP should use try and catch blocks to handle potential exceptions. For example, if users leave the fields empty or enter a non-numerical input, an exception will be thrown.
You should process the exception in the catch block by displaying a specific message informing users that X and Y must be numbers and calling the exceptions getMessage method to display general info of the exception (see sample screenshot 2).
3. Next, create an html page2, which is similar to page1 except that it calls a different JSP to process the form and presents the result in the JSP page, not inside the iframe.
4. Create a JSP that processes the Form in page2.
Depending on the operator button clicked by the user, the JSP should process user inputs, calculate and display the result.
This JSP uses an error page (another JSP file) to handle potential exceptions (sample screenshots 3 and 4).
o Create the error page for the second JSP. This error page should display a specific message informing users that X and Y must be numbers.
o This error page should call the exceptions getMessage method to display general info of the exception.
o This error page should give users an option to go back to provide correct inputs.
5. In one of the html pages, discuss the following:
If using JavaScript, what form data of the html page will you verify? Explain in detail.
Why verifying form data using JavaScript is the preferred approach? Explain in detail.
Prof. Jiang ISM3232 HW4 2 | P a g e
Sample screenshot 1 for page1 and JSP1 using iframe to display processing result
Sample screenshot 2 for page1 and JSP1 using iframe to display error messages
Sample screenshots 3 and 4 of the 2nd JSP page and its error page
2nd JSP page
JSP error page
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started