⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bodynewpaged.jsp

📁 一个用struts tiles的在线影院web系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"
	import="java.util.*,com.eline.vod.utils.caching.*,com.blue.web.common.model.*,com.eline.vod.utils.*,com.eline.vod.client.*,com.eline.vod.model.*,com.blue.web.common.util.*"%>
<%
// Build object cache key for hot movies list.
int pageIndex = 0, pageSize = 12;
int totalPage = 0;
pageIndex = StringUtils.getInt(request.getParameter("page"), 0);
String pageURL = SiteUrls2.getInstance().getProperty("new");
//
String cacheKey = "movies-new-" + pageIndex + "-" + pageSize;
Cache cache = Cache.getInstance();
Page chunk = (Page) cache.get(cacheKey);
if (chunk == null) {
    Movies movies = new Movies();
    MovieCondition condition = new MovieCondition();
    condition.setSortBy(MovieCondition.SortBy_LastUpdate);
    chunk = movies.searchMovie(condition, pageIndex, pageSize);
    if (chunk.getItems().size() > 0) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.add(Calendar.MINUTE, 5);
        cache.add(cacheKey, chunk, cal.getTime(), Cache.NoSlidingExpiration);
    }
}
totalPage = (chunk.getTotalRecords() + (pageSize-1)) / pageSize;
// Is the result empty?
boolean isEmptySet = chunk.getItems().size() < 1;
%>
<!-- bodyTopMovies.jsp -->
<table cellSpacing="0" cellPadding="1" width="100%" border="0">
	<tr>
		<td>
		<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="pager1">
			<tr>
				<td width="50" valign="bottom"><img src="<%= request.getContextPath() %>/images/01/title-right-hot-01.gif"></td>
				<td style="PADDING-TOP: 15px; FONT-WEIGHT: bold; COLOR: #ffffff" width="100"
					background="<%= request.getContextPath() %>/images/02/title-right-hot-bg.gif">&nbsp;最新更新</td>
				<td width="5"><img src="<%= request.getContextPath() %>/images/02/title-right-hot-02.gif"></td>
				<td style="PADDING-TOP: 15px" align="right" background="<%= request.getContextPath() %>/images/02/title-right-hot-bg1.gif">&nbsp;</td>
				<td width="20"><img src="<%= request.getContextPath() %>/images/02/title-right-hot-03.gif"></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<table  bgcolor="#FFAD33" class="body4" style="BORDER: #F7F1E3 1px solid;" cellSpacing="0" cellPadding="3" width="100%" border="0">
<%if (isEmptySet) {
         %>
<%-- 如果数目为空 --%>
	<tr>
		<td align="center">
			影片数为空!
		</td>
	</tr>
<%} else {%>
	<%for (int i = 0; i < chunk.getItems().size(); i++) {
          Movie item = (Movie) chunk.getItems().get(i);
          String movieURL = SiteUrls2.getInstance().getMovieURL() + "?item=" + item.getIndexID();
          if (i % 3 == 0) {%>
	<tr>
		<%}
                 %>
		<td vAlign="top" width="17%">
			<a href="<%=movieURL %>"><img alt="点击进入:<%=item.getTitle() %>" class="imgBorder0" src="<%= request.getContextPath() + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 100, 143)%>" width="100" height="143"></a>
		</td>
		<td vAlign="top" width="17%">
			<!-- 片名:-->
			<a href="<%=movieURL %>"><%=item.getTitle()%></a>
			<br>
			译名:
			<%=item.getOriginName()%>
			<br>
			导演:
			<%=item.getDirector()%>
			<br>
			编剧:
			<%=item.getPlaywright()%>
			<br>
			主演:
			<%=item.getActors()%>
		</td>
		<%if (i % 3 == 2) {%>
	</tr>
	<%}%>
	<%}%>
</table><span style="font-size: 1px">&nbsp;</span><br/>
<!--页码链接处理开始-->
<table width="100%" height="38" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="8">
			<img src="<%= request.getContextPath() %>/images/pager-left.gif" />
		</td>
		<td align="center" background="<%= request.getContextPath() %>/images/pager-bg.gif">
			<table border="0" cellspacing="0" cellpadding="0" class="pager1">
				<tr>
					<td>
						<div align="center">
							<a href="<%=pageURL %>">首页</a>
							<%
if (pageIndex > 0) {
                    %>
							&nbsp;<a href="<%=pageURL + "?page=" + (pageIndex-1) %>">上一页</a>
							<%
}
               	int n1 = 0;
                for (int i = 0; i < totalPage; i++) {
%><%if (i < 3 || (i > (pageIndex-2) && i < (pageIndex + 2)) || i > (totalPage-4)) {
	if (pageIndex == i)	{	n1 = 0;%>&nbsp;|&nbsp;<b><%=(i + 1)%></b><%}else{ %>&nbsp;|&nbsp;<a href="<%=pageURL + "?page=" + i %>"><%=(i + 1)%></a><%}} else {
	if (n1++ < 3) {
		if (n1 == 1){%>&nbsp;|&nbsp;<%}%>.<%}}}%>&nbsp;|<%
if (pageIndex < (totalPage - 1)) {
                    %>
							&nbsp;<a href="<%=pageURL + "?page=" + (pageIndex+1) %>">下一页</a>
							<%}%>
							&nbsp;<a href="<%=pageURL + "?page=" + (totalPage-1)%>">尾页</a>
						</div>
					</td>
					<td></td>
				</tr>
			</table>
		</td>
		<td width="8">
			<img src="<%= request.getContextPath() %>/images/pager-right.gif" />
		</td>
	</tr>
</table>
<!--页码链接处理结束-->
<%}%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -