I have an ID that I need in the next jsp once the user click a button. I am trying to do the following:
FirstJSP.jsp:
function getSecond() { var frm = document.getElementById("frm"); frm.action = "**second.jsp?id=myId;"** frm.submit(); }... form id="frm" ..... input type="button" value="Next" onclick="getSecond()"/
......
This code takes me to my second page, but if I tried to access the id, it gives me an error since the id is null.
I access the id in the second page by:
final Long passedId = Long.parseLong(request.getParameter("id"));
I think I am not passing the parameter correctly, but I don't know how to do it. Any ideas? Thank you so much!