java 里List<date>把集合里的连续时间(按天)进行分割,拼接成时间连续的字符串输出
发布网友
发布时间:2022-10-11 13:01
我来回答
共1个回答
热心网友
时间:2023-10-13 00:24
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String basePath = request.getContextPath() + "/";
%>
<html>
<head>
<title>新闻列表</title>
<script type="text/javascript" language="javascript"
src="<%=basePath%>resources/js/jquery.js"></script>
<script type="text/javascript" language="javascript"
src="<%=basePath%>resources/js/json2.js"></script>
</head>
<body>
<form id="hrq" method="post">
<input type="hidden" id="totalPage" name="totalPages"
value="${pageInfo.totalPages}" />
<input type="hidden" id="currentPage" name="currentPage"
value="${pageInfo.currentPage}" />
<s:if test="%{newsBeanList.size > 0}">
<s:iterator value="newsBeanList">
<tr>
<a href="javascript:void(0)" onclick="queryNewsInfo('${newsContent}')">
<s:property value="%{newsContent}" />
</a>
<br/>
</tr>
</s:iterator>
</s:if>
<s:else>
<tr>
<td style="text-align: center">
无记录
</td>
</tr>
</s:else>
<tr>
<th align="right" colspan="9">
<span>
<input type="button" value='上一页' onClick="doGoToLastPagebutton(document.getElementById('currentPage').value)" />
<input type="button" value='下一页' onClick="doGoToNextPagebutton(document.getElementById('currentPage').value)" />
<input type="button" value='末页' onClick="doGoToEndPagebutton(document.getElementById('totalPage').value)" />
<input type="text" style="display: none;" />
<input type="text" id="gotoPage" value="" size="4" maxlength="8" />
<input type="button" value='跳转' onClick="doGoToPagebutton(document.getElementById('gotoPage').value)" />
</span>
</th>
</tr>
</form>
<script type="text/javascript">
/**
* 分页跳转
*/
function doGoToPagebutton(gotoPage)
{
if(gotoPage == 0)
{
gotoPage = 1;
}
document.forms[0].target = "";
document.forms[0].action = "<%=basePath%>regionNews/queryRegionNews.action?pageInfo.numPerPage=${pageInfo.numPerPage}&pageInfo.currentPage=" + gotoPage;
document.forms[0].submit();
}
//上一页
function doGoToLastPagebutton(currentPage)
{
var gotoPage;
if(currentPage==1)
{
gotoPage =1;
}
else
{
gotoPage = currentPage -1;
}
document.forms[0].target = "";
document.forms[0].action = "<%=basePath%>regionNews/queryRegionNews.action?pageInfo.numPerPage=${pageInfo.numPerPage}&pageInfo.currentPage=" + gotoPage;
document.forms[0].submit();
}
//下一页
function doGoToNextPagebutton(currentPage)
{
var gotoPage;
gotoPage = parseInt(currentPage) +parseInt(1);
document.forms[0].target = "";
document.forms[0].action = "<%=basePath%>regionNews/queryRegionNews.action?pageInfo.numPerPage=${pageInfo.numPerPage}&pageInfo.currentPage=" + gotoPage;
document.forms[0].submit();
}
//末页
function doGoToEndPagebutton(totalPage)
{
document.forms[0].target = "";
document.forms[0].action = "<%=basePath%>regionNews/queryRegionNews.action?pageInfo.numPerPage=${pageInfo.numPerPage}&pageInfo.currentPage=" + totalPage;
document.forms[0].submit();
}
</script>
</body>
</html>