jsp页面怎么获取另一个页面的内容
展开全部
可以利用form表单提交获取上一个页面的值
例:form表单提交传值及取值
发请求页面
<form style="display: none" method="post"
id="infoDetailsHyperlink" name="input"
action="<%=request.getContextPath()%>/view/basicmanage/reportTemplet/positionPeopleConfig.jsp">
<input name="infoId" id="infoId">
<input name="operationType" id="operationType">
<input name="copyTempletIdConfigPeople" id="copyTempletIdConfigPeople">
</form>
发请求页面,js中发送请求
$("#infoId").val($("#lastStepTempletId").val());
$("#operationType").val($("#operationTypeIdLastStep").val());
$("#infoDetailsHyperlink").submit();
接收页面
<input id="infoId" style="display: none;" value=<%=request.getParameter("infoId")%>>
<input id="operationType" style="display: none;" value=<%=request.getParameter("operationType")%>>
<input id="copyTempletIdConfigPeople" style="display: none;" value=<%=request.getParameter("copyTempletIdConfigPeople")%>>
<script>
<%request.setCharacterEncoding("utf-8");%> 解决传值时中文乱码问题
</script>
例:form表单提交传值及取值
发请求页面
<form style="display: none" method="post"
id="infoDetailsHyperlink" name="input"
action="<%=request.getContextPath()%>/view/basicmanage/reportTemplet/positionPeopleConfig.jsp">
<input name="infoId" id="infoId">
<input name="operationType" id="operationType">
<input name="copyTempletIdConfigPeople" id="copyTempletIdConfigPeople">
</form>
发请求页面,js中发送请求
$("#infoId").val($("#lastStepTempletId").val());
$("#operationType").val($("#operationTypeIdLastStep").val());
$("#infoDetailsHyperlink").submit();
接收页面
<input id="infoId" style="display: none;" value=<%=request.getParameter("infoId")%>>
<input id="operationType" style="display: none;" value=<%=request.getParameter("operationType")%>>
<input id="copyTempletIdConfigPeople" style="display: none;" value=<%=request.getParameter("copyTempletIdConfigPeople")%>>
<script>
<%request.setCharacterEncoding("utf-8");%> 解决传值时中文乱码问题
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询