如何在jsp中调用js里面的参数
实例如下
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<form method="post" action="Text.jsp" id="passForm" name="passForm">
<input id="text2" type="hidden" name="text2">
</form>
</body>
<%
request.setCharacterEncoding("utf-8");
String msg=request.getParameter("text2");
out.println(msg);
%>
<script type="text/javascript">
let text1=200;
document.forms['passForm'].text2.value=text1;
let formObj=document.getElementById('passForm');
formObj.submit();
</script>
</html>
页面显示 msg的值为 200