Pass value from javascript to Jsp scriplet:
h.jsp:
<script>
function get(){
var m="Hello";
window.location.replace("h.jsp?mess="+m);
}
</script>
<input type="button" onclick="get();" value="click">
<%String message=request.getParameter("mess");
out.println(message);
%
source:https://www.javatpoint.com/q/5474/can-we-access-javascript-variable-in-jsp-and-vice-versa
No comments:
Post a Comment