欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Java 动态加载jsp页面 在div 刷新这么简单 就可以实现了

程序员文章站 2022-07-15 09:30:29
...
引用

<script type="text/javascript">
var url="<%=basePath%>/qne.do?p=pessegerCountSet";
           $.post(url,{id:count},function(h){
                document.getElementById("paserDivid").innerHTML=h;
                });
</script>

只需要这个脚本就够了,只是比较简单
引用


<td colspan="8">
<div id="paserDivid">
</td>

action里面:
public ActionForward pessegerCountSet(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		System.out.println("===");
		request.setAttribute("paserCount", Integer.parseInt(request.getParameter("id")));
		return new ActionForward("/qneBusiness/passengerInfo.jsp");
	}