jsp中select标签下拉框选一个条件后,点查询只能查询第一页的,第二页的不显示
List<DeviceState> deviceStateList = (List<DeviceState>)request.getAttribute("deviceStateList");
DeviceState deviceState = (DeviceState)request.getAttribute("deviceState");
设备状态:<select name="deviceStateObj.deviceStateId">
<option value="0">不限制</option>
<%
for(DeviceState deviceStateTemp:deviceStateList) {
%>
<option value="<%=deviceStateTemp.getDeviceStateId() %>"><%=deviceStateTemp.getDeviceState() %></option>
<%
}
%>
</select>
<input type=submit value="查询" onclick="QueryDeviceInfo();"/>
/*查询DeviceInfo信息*/
public String QueryDeviceInfo() {
if(currentPage == 0) currentPage = 1;
if(deviceNumber == null) deviceNumber = "";
if(deviceName == null) deviceName = "";
if(leaveFactoryDate == null) leaveFactoryDate = "";
List<DeviceInfo> deviceInfoList = deviceInfoDAO.QueryDeviceInfoInfo(deviceNumber, deviceClassObj, departmentObj, deviceName,deviceNum, deviceStateObj, addWayObj, leaveFactoryDate, currentPage);
/*计算总的页数和总的记录数*/
deviceInfoDAO.CalculateTotalPageAndRecordNumber(deviceNumber, deviceClassObj, departmentObj, deviceName, deviceNum,deviceStateObj, addWayObj, leaveFactoryDate);
/*获取到总的页码数目*/
totalPage = deviceInfoDAO.getTotalPage();
/*当前查询条件下总记录数*/
recordNumber = deviceInfoDAO.getRecordNumber();
ActionContext ctx = ActionContext.getContext();
ctx.put("deviceInfoList", deviceInfoList);
ctx.put("totalPage", totalPage);
ctx.put("recordNumber", recordNumber);
ctx.put("currentPage", currentPage);
ctx.put("deviceNumber", deviceNumber);
ctx.put("deviceClassObj", deviceClassObj);
DeviceClassDAO deviceClassDAO = new DeviceClassDAO();
List<DeviceClass> deviceClassList = deviceClassDAO.QueryAllDeviceClassInfo();
ctx.put("deviceClassList", deviceClassList);
ctx.put("departmentObj", departmentObj);
DepartmentDAO departmentDAO = new DepartmentDAO();
List<Department> departmentList = departmentDAO.QueryAllDepartmentInfo();
ctx.put("departmentList", departmentList);
ctx.put("deviceName", deviceName);
ctx.put("deviceNum", deviceNum);
ctx.put("deviceStateObj", deviceStateObj);
DeviceStateDAO deviceStateDAO = new DeviceStateDAO();
List<DeviceState> deviceStateList = deviceStateDAO.QueryAllDeviceStateInfo();
ctx.put("deviceStateList", deviceStateList);
ctx.put("addWayObj", addWayObj);
AddWayDAO addWayDAO = new AddWayDAO();
List<AddWay> addWayList = addWayDAO.QueryAllAddWayInfo();
ctx.put("addWayList", addWayList);
ctx.put("leaveFactoryDate", leaveFactoryDate);
return "query_view";
同一查询条件的text文本框就没问题,就是select下拉选一个后点查询,第一页可以,点下一页就变回默认值了,或者怎么使选一次后,查询所有的下拉框中的值。谢谢
相关推荐
JSP自定义标签实战:封装动态<select>下拉标签
在现代Java Web开发中,我们常常会陷入“写了一堆脚本片段却越来越难维护”的怪圈。想象一下这个场景:你的项目里有15个JSP页面都用到了部门下拉框,每个页面都重复写着几乎一模一样的数据库查询和HTML拼接代码。这时候,如果哪天产品经理突然说“所有下拉框要加上默认提示项”,你是不是已经开始头皮发麻了?😅 别担心,今天我们要聊的JSP自定义标签,就是来拯救这种“复制粘贴地狱”的神器!它不仅能让你告别满屏的<% %>,还能把复杂逻辑封装成像。
JSP——分页查询
JSP分页查询
正交拉丁超立方(OLHC)分组与实验设计(DOE)评估的优化Python实现.rar
正交拉丁超立方(OLHC)分组与实验设计(DOE)评估的优化Python实现.rar
Java微服务如何拆解审计日志查询服务
标题:Java微服务如何拆解审计日志查询服务 内容概要:围绕缓存策略、任务调度、回压控制和审计追踪,拆解Java微服务如何拆解审计日志查询服务的实现细节。 xdronline.com xdrea.com 9g.xinmei6.com xinghaohuanbao.com m.xiker66.com
港股十档行情tick数据涵盖逐笔成交与委托,记录每笔买卖价格、成交量及挂单明细 逐笔数据包含成交时间、价格、股数、成交方向,委托数据展示买一至买十、卖一至卖十的价格与数量
港股十档行情tick数据涵盖逐笔成交与委托,记录每笔买卖价格、成交量及挂单明细。逐笔数据包含成交时间、价格、股数、成交方向,委托数据展示买一至买十、卖一至卖十的价格与数量。分钟数据汇总每分钟开盘价、最高价、最低价、收盘价、成交量及成交额。历史行情覆盖近十五年,字段清晰完整,便于回溯分析。 数据源:CMES金融数据库


Web 开发
