I have a jsp page, insert.jsp, and it has a submit button. When submit is clicked I want to display another page, confirminsert.jsp, and echo back the values that the user entered on insert.jsp. How do I implement that?
I have a jsp page, insert.jsp , and it has a submit button. When
Share
You don’t need JavaScript/jQuery for this. Your
insert.jsppage should have a form element that contains the inputs that the user enters values in. On submit these become request parameters thatconfirminsert.jspcan access in server-side code and it can then echo the values back out again.You don’t say what sort of JSP framework (if any) that you’re working with so I’ll stick to a really basic example:
In
insert.jsp:In
confirminsert.jsp:As you can see, the names passed to the
request.getParameter()function are the same as the names of the input fields.