社区
Web 开发
帖子详情
关于list循环到前台更新不了的问题
gx2425030
2009-03-25 01:12:59
我在jsp前台循环出list,把list其中的一条记录修改后提交,然后在跳回该jsp页面但是跳回来还是修改前的记录,没有返回修改后的list。
...全文
125
5
打赏
收藏
关于list循环到前台更新不了的问题
我在jsp前台循环出list,把list其中的一条记录修改后提交,然后在跳回该jsp页面但是跳回来还是修改前的记录,没有返回修改后的list。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
gx2425030
2009-03-25
打赏
举报
回复
父窗口代码
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<html>
<head>
<title>车辆调拨</title>
<link rel="stylesheet" type="text/css"
href="${pageContext.request.contextPath}/css/style.css">
<script type="text/javascript"
src="${pageContext.request.contextPath}/js/date.js"></script>
<script type="text/javascript">
function oop(url){
<%-- alert(gongsi)--%>
window.open(url,"" ,
"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=300,height=100,left=300, top=200");
}
</script>
</head>
<body>
<html:form action="jihuafenpei.do" method="post" styleId="form1">
<fieldset style="width:100%;padding-bottom:5px;">
<legend>
<b>承运任务管理</b>
</legend>
<table>
<input type="hidden" name="method" value="findByTimeandCom" />
<tr>
<td>
请选择查询时间:
</td>
<td>
<html:text property="danqianriqi"
onclick="CalendarWebControl.show(this,false,this.value);"
style="width:100px" />
</td>
<%-- <td>--%>
<%-- 请选择运输公司:--%>
<%-- <c:if test="${account.partname eq '3'}">--%>
<%-- <input type="text" name="yunshugongsi" value="${account.username}" readonly="readonly" />--%>
<%-- </c:if>--%>
<%-- <c:if test="${account.partname ne '3'}">--%>
<%-- <input type="text" name="yunshugongsi" />--%>
<%-- </c:if>--%>
<%-- </td>--%>
<td>
<html:submit style="width:90px" value="查询未审核"
onclick="method.value='findByTimeandCom'" styleClass="BigButton" />
</td>
<%--<input type="hidden" name="method" value="findByTimeandCom" />--%>
<td>
<html:submit style="width:90px" value="查询以审核" onclick="method.value='findByTimeandCom1'" styleClass="BigButton"/>
</td>
</tr>
</table>
</fieldset>
<br>
<br>
<table border="0" cellspacing="1" class="tablestyle1">
<logic:present name="list">
<tr class="TableHeader" align="center">
<td>
计划批次
</td>
<td>
计划录入时间
</td>
<td>
分配日期
</td>
<td>
发车地点
</td>
<td>
运输公司
</td>
<td>
销售店
</td>
<td>
省份
</td>
<td>
是否调拨任务
</td>
<td>
台数
</td>
<td>
车牌号
</td>
<td>
操作
</td>
</tr>
<logic:iterate id="templist" name="list" >
<tr class="TableLine1" align="center">
<html:hidden property="idbiaoshi" value="${templist.idbiaoshi}"/>
<td>
<bean:write name="templist" property="jihuapici"/>
</td>
<td>
<bean:write name="templist" property="jihuashijian"/>
</td>
<td>
<bean:write name="templist" property="danqianriqi" />
</td>
<td>
<bean:write name="templist" property="jihuadidian"/>
</td>
<td>
<bean:write name="templist" property="yunshugongsi"/>
</td>
<td>
<bean:write name="templist" property="xiaoshoudian"/>
</td>
<td>
<bean:write name="templist" property="shengfen"/>
</td>
<td>
<bean:write name="templist" property="shifoudiaochu"/>
</td>
<td>
<bean:write name="templist" property="taishu"/>
</td>
<td>
<%-- <input type="text" name="cifatianshu" value="${templist.cifatianshu}"/>--%>
<%-- <html:text property="cifatianshu" value="${templist.cifatianshu}"/>--%>
<bean:write name="templist" property="cifatianshu"/>
</td>
<td>
<%-- <a id="xyz" href="${pageContext.request.contextPath}/jihua/carnumber.jsp?id=${templist.idbiaoshi}&page=${fenye.nowpage}&shijian=${shijian}&gongsi=${gongsi}">完成</a>--%>
<a id="xyz" href="javascript:oop('${pageContext.request.contextPath}/jihua/carnumber.jsp?id=${templist.idbiaoshi}&page=${fenye.nowpage}&shijian=${shijian}&gongsi=${gongsi}');">填写车牌</a>
</td>
</tr>
</logic:iterate>
</logic:present>
<c:if test="${list!=null}">
<tr class="TableLine1">
<td colspan="17" align="right">
<input type="hidden" name="page" value="${fenye.nowpage }"/>
<input type="hidden" name="shijian" value="${shijian }"/>
<input type="hidden" name="gongsi" value="${gongsi }"/>
共有${fenye.pagecount} 页||现在是第${fenye.nowpage}页||共有${fenye.allcount
}条记录
<c:if test="${fenye.nowpage!=1}">
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=1&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">首页</a>
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.nowpage-1}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">上一页</a>
</c:if>
<c:if test="${fenye.nowpage!=fenye.pagecount}">
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.nowpage+1}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">下一页</a>
<a
href="${pageContext.request.contextPath}/jihuafenpei.do?method=findByTimeandCom&&page=${fenye.pagecount}&&danqianriqi=${shijian}&&yunshugongsi=${gongsi}">尾页</a>
</c:if>
</td>
</tr>
</c:if>
</table>
</html:form>
</body>
</html>
gx2425030
2009-03-25
打赏
举报
回复
子窗口代码
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>填写车牌号</title>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function check(){
document.form1.submit();
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow){
window.opener.progressWindow.close();
}
window.close();
}
</script>
</head>
<body>
<form action="jihuafenpei.do?method=AmendNumPlate" method="post" name="form1">
<input type="hidden" name="idbiaoshi" value="<%=request.getParameter("id") %>"/>
<input type="hidden" name="page" value="<%=request.getParameter("page") %>">
<input type="hidden" name="danqianriqi" value="<%=request.getParameter("shijian") %>">
<input type="hidden" name="yunshugongsi" value="<%=request.getParameter("gongsi") %>">
<table align="center">
<tr>
<td><input type="text" name="cifatianshu" /></td>
</tr>
<tr>
<td><input type="button" name="button" value="提交" onclick="check()"/></td>
</tr>
</table>
</form>
</body>
</html>
ouyangxiaokang6
2009-03-25
打赏
举报
回复
子窗口的提交的时候,是不是list没有提交呀。导致list没有更新。
你怎么写的,上代码
gx2425030
2009-03-25
打赏
举报
回复
我用的方法是,修改的时候跳出子窗口,然后点击子窗口的提交,关闭子窗口然后刷新父窗口
sjkof
2009-03-25
打赏
举报
回复
你用的什么办法来跳转的?
Java中
前台
接收后台
List
数据并
循环
打印
在Java后端获取到了数据,然后我们需要传到前端页面展现出来。 方法有两种: 方法一: 后端: request.setAttribute("
list
",
list
); 前端: &lt;% Array
List
list
= (Array
List
) request.getAttribute("
list
"); /* 接受
list
集合 */ %&gt; &lt;table&
Springboot页面跳转时后台往
前台
传递
list
Springboot页面跳转时后台往
前台
传递
list
编程小白,记录一下自己学习过程中解决的
问题
。 需求:目前在写一个影院票务系统,现在要实现点击电影场次后跳转到选座位的页面,页面上要能显示当前场次的座位预订情况。 分析:通过点击页面A中的按钮跳转到页面B,期间
前台
要往后台传一个场次id,后台根据id查询出一个座位
list
再传回
前台
,
前台
再根据
list
中的数据对网页元素进行渲染。 Controll...
spring boot 给
前台
返json数据(
list
)出现死
循环
与
前台
开发人员联调过程中,
前台
需要我给他返回一些符合特定条件的实体数据,直接按正常流程查询,最终查到了3个实体数据,以
list
接收后,便以json格式返给了
前台
, 控制层代码如下(有简化): 可是数据返回到了
前台
的时候却出现了
前台
接受的数据疯狂输出(明明只有三个数据啊,我打断点看的清清楚楚),直到后台报错,后台最后报错如下: 最终看到实体类后找到了原因: 这里要返回给
前台
的实体
前台
list
遍历map集合
这里写自定义目录标题freemarker
前台
遍历map
问题
freemarker
前台
遍历map
问题
// 使用freemarker
前台
list
遍历map集合的时候如果想要根据key值获取value需要map的key值是String类型的否则报错 后台列: Map<String,
List
<String>> versionmap=new HashMap<>(); Html列: <#
list
namemap?keys as key> <#
list
name
关于freemarker中
循环
list
中的map
问题
1.从
List
集合取一个Map集 例如: Java代码:
List
list
= new Array
List
(); Map map1 = new HashMap(); map1.put("phone", "13655555555"); map1.put("email", "admin@vip.com");
list
.add(map1); Map map2 = new
Web 开发
81,111
社区成员
341,693
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章