<html>
<script>
function call()
{ var name = "Gautam";
window.location.replace("Demo2.jsp?name=" + name);
}
</script>
<input type="button" value="Get" onclick='call()'>
<%
String name = request.getParameter("name");
if (name != null)
{
out.println(name);
}
%></html> source: https://stackoverflow.com/questions/22922245/get-javascript-variable-value-in-jsp-scriptlet
<script>
function call()
{ var name = "Gautam";
window.location.replace("Demo2.jsp?name=" + name);
}
</script>
<input type="button" value="Get" onclick='call()'>
<%
String name = request.getParameter("name");
if (name != null)
{
out.println(name);
}
%></html> source: https://stackoverflow.com/questions/22922245/get-javascript-variable-value-in-jsp-scriptlet
No comments:
Post a Comment