Q19

Question 19

Make two files as follows:

a. main.html: shows 2 text boxes and 3 radio buttons with values "addition", "subtraction" and "multiplication" b. operate.jsp: depending on what the user selects perform the corresponding function (Give two implementations: using request.getParameter() and using expression language)

Created main.html as mentioned and taking two numbers as number input and operator as checkbox with corresponding operation value (+,-,*). Created CalcServlet.java to handle url pattern "Q19/" and render page main.html and then submit post request to url pattern "Q19/OperationsServlet" which is handled by OperationsServlet.java

****Browse Code Here **

Code

Output

main.html (1/7)
Adding Two Numbers (2/7)
Answer of Addition of Two Numbers (3/7)
Subtracting Two Numbers (4/7)
Answer of Subtracting Two Numbers (5/7)
Multiplying two Numbers (6/7)
Answer of Multiplication of Two Numbers (7/7)
Run Code Here

Last updated