steps
1. create a servlet class, move your jsp scriptlet code to servlet.
2. configure servlet class into web.xml file.
3. create a form have value1, value2 textbox and submit button.
4. press the submit button call the servlet url which you configured in web.xml.
5. once process done in servlet class, pass response as html.
6. Get the response from jsp page, and print.