JAVA JSP中查询和刷新在同一个页面中,点击查询怎么保留查询条件
这是jsp
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs_new.jsp"%>
<html>
<head>
<title>页面展示</title>
<script>
//页面展示
function query(){
with(document.forms[0]){
operAtt.value="query";
pages.value="";
Submit();
}
}
//新增记录
function add(){
location="${ctx}/CcGuarinfoAction.do?operAtt=add";
}
//修改记录
function edit(guarNo,guarType) {
location = "${ctx}/CcGuarinfoAction.do?operAtt=edit&ccGuarinfoDomain.guarNo="+guarNo+"&ccGuarinfoDomain.guarType="+guarType;
}
//删除一条记录
function delete1(guarNo,guarType){
if(confirm("确定要删除吗?")){
location="${ctx}/CcGuarinfoAction.do?operAtt=delete1&ccGuarinfoDomain.guarNo="+guarNo+"&ccGuarinfoDomain.guarType="+guarType;
}
}
//选中在页面需要删除的记录
function deleteMore(){
if(confirm("确定要删除吗?")){
with(document.forms[0]){
operAtt.value="deleteMore";
var check = document.getElementsByName("list_check");
var delstr="";
for(var i=0;i<check.length;i++){
if(check[i].checked){
delstr+= ":"+check[i].value;
}
}
delstr= delstr.substring(1,delstr.length);
delParam.value = delstr;
document.forms[0].Submit();
}
}
}
//查看信息
function showDetail(guarNo,guarType){
location="${ctx}/CcGuarinfoAction.do?operAtt=search&ccGuarinfoDomain.guarNo="+guarNo+"&ccGuarinfoDomain.guarType="+guarType;
}
</script>
</head>
<body>
<form action="${ctx}/CcGuarinfoAction.do" method="post" >
<input type="hidden" id="operAtt" name="operAtt" >
<input type="hidden" id="pages" name="pages">
<input type="hidden" name="delParam" id="delParam">
<p:pagelayout>
<p:searchlayout>
<p:messages/>
<table class="mainstyle">
<tr>
<th>编号</th>
<td>
<input name="ccGuarinfoDomain.guarNo" type="text" value="${ccGuarinfoDomain.guarNo}"/>
</td>
<th>类型代码</th>
<td>
<input name="ccGuarinfoDomain.guarType" type="text" value="${ccGuarinfoDomain.guarType}"/>
</td>
</tr>
</table>
</p:searchlayout>
<p:searchtblayout>
<a class="button" href="#" onclick="javascript:query()"><span>开始检索</span></a>
<a class="button" href="#" onclick="resetForm()"><span>重 置</span></a>
</p:searchtblayout>
<p:panelbar>
<a class="addicon" href="#" onclick="javascript:add();return false;">添加</a>
<a class="delicon" href="#" onclick="javascript:deleteMore();return false;">选择删除</a>
</p:panelbar>
<p:pageclayout>
<div id="ptdiv" class="pageContent" fixtitle="true">
<table class="resultlst1" fixtitle="true" >
<tr>
<th width="5%" title="全选"><input id="checkAll" type="checkbox"/>全选</th>
<th nowrap="