此处为通过button调用函数进行跳转
在a.jsp中写入
<form id = "alignCenterOne" method="post">
<input id="distination" type="email" placeholder="出行目的地">
<button type="button" onclick="MainToInfo()">搜索</button>
</form>
<script LANGUAGE="JavaScript">
/*从ViewHotelMain跳转到ViewHotelInfo*/
function MainToInfo()
{
var distination = $("#distination");
var distinationValue = distination.val();
window.location.href ="a.jsp?distination="+distinationValue+"";
}
</script>
上面是传递数据的文件 下面是接收数据文件b.jsp
<% String distination = request.getParameter("distination"); %>
<h4><%=distination%></h4>