jsp 发送请求的另一个思路

<html>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<script>
function tijiao1(action,a){
 
	if(action=="button"){
	
		$("#form").attr("action","<%=basePath%>inc/weishengxinyudu/wsxyd.html?action=findbySearch&pageNo=1");
	}

	if(action=="lastPage"){
			$("#form").attr("action","<%=basePath%>inc/weishengxinyudu/wsxyd.html?action=${empty(param.action)?'findbyPage':param.action}&pageNo="+a);
	}
	if(action=="nextPage"){
		
		$("#form").attr("action","<%=basePath%>inc/weishengxinyudu/wsxyd.html?action=${empty(param.action)?'findbyPage':param.action}&pageNo="+a);
		
	}
	if(action=="lastData")
	{
		$("#form").attr("action","<%=basePath%>inc/weishengxinyudu/wsxyd.html?action=${empty(param.action)?'findbyPage':param.action}&pageNo="+a);
	}
	if(action=="firstPage")
	{
		$("#form").attr("action","<%=basePath%>inc/weishengxinyudu/wsxyd.html?action=${empty(param.action)?'findbyPage':param.action}&pageNo=1");
	}
	document.getElementById("form").submit();
	
};
</script>
</head>


<body>


  <s:action name="JdjWsxyd_all" executeResult="true" namespace="/" >
<s:param name="action" value="#empty(param.action)?'findPage':param.action"></s:param>
</s:action>
 

<form action="<%=basePath%>inc/weishengxinyudu/wsxyd.html" id="form" name="form" method="post">
																								    <input type="button" value="查询" style="CURSOR: hand" src="<%=basePath%>images/biaogechaxun.gif"  onclick="tijiao1('button','tijiao')">
														

</body>
</html>

你可能感兴趣的:(jsp)