function submit() {
var name = document.getElementById('name').value;
var mob = document.getElementById('number').value;
sessionStorage.setItem("name", name);
sessionStorage.setItem("mob", mob);
document.getElementById("leadForm").action = "/confirm";
document.leadForm.submit();
}
On the confirm page, my JSP is called where I want to print this name and mob passed in a session, and along with it, one more attribute selected on this page, I have to pass it to another page.
I am not sure how to get session values from JavaScript to JSP.
Writing in my JSP page:
String name = (String) session.getAttribute("name");
out.println(name);
I am getting null value.