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

📄 bodyoldmovies.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.*"%>
<%!
/**
 * 获取影片简介信息的索引
 */
String adjustIntroLength(String str, int length) {
	if (str == null)
		return "不错的电影";
	if (str.length() <= length)
		return str;
	return str.substring(0, length) + "...";
}
%><%
String cacheKey = "movies-group:15-0-9";
Cache cache = Cache.getInstance();
Page chunk = (Page) cache.get(cacheKey);	// 尝试从cache中获取数据
if (chunk == null) {						// 如果失败则从数据库获取
	chunk = Groups.searchMovie(null, 15, 0, 9);
	if (chunk.getItems().size() > 0) {		// 如果有数据则放入cache并设定1分钟超期
		Calendar cal = Calendar.getInstance();
		cal.setTime(new Date());
		cal.add(Calendar.MINUTE, 5);
		cache.add(cacheKey, chunk, cal.getTime(), Cache.NoSlidingExpiration);
	}
}
// 判断影片数目是否为0
boolean isEmptySet = chunk.getItems().size() < 1;
String movieURL = SiteUrls2.getInstance().getMovieURL() + "?group=15&item=";
String groupURL = SiteUrls2.getInstance().getMovieGroupURL() + "?group=15";

%><table cellSpacing="0"
	cellPadding="1" width="100%" border="0">
	<tr>
		<td colSpan="4">
			<table cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td width="50"><img src="<%= request.getContextPath() %>/images/01/title-right-old-01.gif"></td>
					<td class="title0" width="100" background="<%= request.getContextPath() %>/images/01/title-right-hot-bg.gif">&nbsp;<a href="<%=groupURL %>">经典老片回放</a></td>
					<td width="5"><img src="<%= request.getContextPath() %>/images/01/title-right-hot-02.gif"></td>
					<td background="<%= request.getContextPath() %>/images/01/title-right-hot-bg1.gif">&nbsp;</td>
					<td width="90"><a href="<%=groupURL %>"><img alt="点击进入" border="0" src="<%= request.getContextPath() %>/images/01/title-right-hot-03.gif"></a></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
		<%if (isEmptySet) {%>
			<table borderColor="#ffffcc" height="100%" cellSpacing="0" cellPadding="0" width="100%"
				bgColor="#ff9900" border="0">
				<tr><td align="center">影片数为空!</td></tr>
			</table>
		<%} else {%>
			<table borderColor="#ffffcc" height="100%" cellSpacing="0" cellPadding="0" width="100%"
				bgColor="#ff9900" border="0">
				<tr>
					<!-- 经典老片:左边 -->
					<td vAlign="top" width="160">
						<table class="body3" style="BORDER-BOTTOM: #ffffff 1px dashed" height="480" cellSpacing="0"
							cellPadding="5" width="100%" border="0">
							<%
							int i;
							for (i = 0; i < 2 && i < chunk.getItems().size(); i ++) {
								Movie item = (Movie) chunk.getItems().get(i);
							%>
							<tr>
								<td vAlign="middle" align="center">
									<table cellSpacing="1" cellPadding="4" width="81%" bgColor="#e0dcdb" border="0">
										<tr>
											<td bgColor="#ffffff"><a href="<%=movieURL + item.getIndexID() %>"><img alt="点击进入:<%=item.getTitle() %>" border="0" src="<%= request.getContextPath()  + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 125, 160)%>" width="125" height="160"></a></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td height="50"><a href="<%=movieURL + item.getIndexID() %>"><%=item.getTitle() %></a><br>
									简介:<%=adjustIntroLength(item.getIntro(), 20) %></td>
							</tr>
							<%} %>
						</table>
					</td>
					<td width="1" bgColor="#ffffff">
						<div style="FONT-SIZE: 1px"></div>
					</td>
					<!-- 经典老片:中间 -->
					<td vAlign="top" width="235">
						<table cellSpacing="0" cellPadding="5" width="100%" border="0">
							<%for (; i < chunk.getItems().size() && i < 4; i ++) {
								Movie item = (Movie) chunk.getItems().get(i);
							%>							<tr>
								<td style="BORDER-BOTTOM: #ffffff 1px dashed" height="120">
									<table class="body3" borderColor="#ffffcc" cellSpacing="0" cellPadding="0" width="100%"
										border="0">
										<tr>
											<td width="57%"><a href="<%=movieURL + item.getIndexID() %>"><%=item.getTitle() %></a><br>
												<br>
												简介:<%= adjustIntroLength(item.getIntro(), 35)%></td>
											<td vAlign="top" align="center">
												<table cellSpacing="1" cellPadding="3" width="10%" bgColor="#e0dcdb" border="0">
													<tr>
														<td bgColor="#ffffff"><a href="<%=movieURL + item.getIndexID() %>"><img alt="点击进入:<%=item.getTitle() %>" border="0" height="94" src="<%= request.getContextPath()  + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 82, 94)%>" width="82"></a></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<%} %>
							<%for (; i < chunk.getItems().size() && i < 6; i ++) {
								Movie item = (Movie) chunk.getItems().get(i);
							%>
							<tr>
								<td style="BORDER-BOTTOM: #ffffff 1px dashed" height="120">
									<table class="body3" borderColor="#ffffcc" cellSpacing="0" cellPadding="0" width="100%"
										border="0">
										<tr>
											<td align="center">
												<table cellSpacing="1" cellPadding="3" width="10%" bgColor="#e0dcdb" border="0">
													<tr>
														<td bgColor="#ffffff"><a href="<%=movieURL + item.getIndexID() %>"><img alt="点击进入:<%=item.getTitle() %>" border="0" height="94" src="<%= request.getContextPath()  + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 82, 94)%>" width="82"></a></td>
													</tr>
												</table>
											</td>
											<td width="57%"><a href="<%=movieURL + item.getIndexID() %>"><%=item.getTitle() %></a><br>
												<br>
												<%= adjustIntroLength(item.getIntro(), 35)%></td>
										</tr>
									</table>
								</td>
							</tr>
							<%} %>
						</table>
					</td>
					<td width="1" bgColor="#ffffff">
						<div style="FONT-SIZE: 1px"></div>
					</td>
					<!-- 经典老片:右边 -->
					<td vAlign="top">
						<table cellSpacing="0" cellPadding="5" width="100%" border="0">
							<%for (; i < chunk.getItems().size() && i < 8; i ++) {
								Movie item = (Movie) chunk.getItems().get(i);
							%>
							<tr>
								<td style="BORDER-BOTTOM: #ffffff 1px dashed" height="120">
									<table class="body3" borderColor="#ffffcc" cellSpacing="0" cellPadding="0" width="100%"
										border="0">
										<tr>
											<td width="57%"><a href="<%=movieURL + item.getIndexID() %>"><%=item.getTitle() %></a><br>
												<br>
												简介:<%= adjustIntroLength(item.getIntro(), 35)%></td>
											<td vAlign="top" align="center">
												<table cellSpacing="1" cellPadding="3" width="10%" bgColor="#e0dcdb" border="0">
													<tr>
														<td bgColor="#ffffff"><a href="<%=movieURL + item.getIndexID() %>"><img alt="点击进入:<%=item.getTitle() %>" border="0" height="94" src="<%= request.getContextPath()  + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 82, 94)%>" width="82"></a></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<%} %>
							<tr>
								<td style="BORDER-BOTTOM: #ffffff 1px dashed" align="center" height="120">
									<table cellSpacing="1" cellPadding="3" bgColor="#e0dcdb" border="0">
										<tr>
											<td bgColor="#ffffff"><img src="<%= request.getContextPath() %>/temp/right-temp-218x74_1.jpg"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td style="BORDER-BOTTOM: #ffffff 1px dashed" vAlign="bottom" align="center" height="120">
									<table class="body3" height="100" cellSpacing="1" cellPadding="0" width="100%" border="0">
										<tr>
											<td>[经典老片]移动城堡</td>
											<td>[经典老片]移动城堡</td>
										</tr>
										<tr>
											<td>[经典老片]移动城堡</td>
											<td>[经典老片]移动城堡</td>
										</tr>
										<tr>
											<td>[经典老片]移动城堡</td>
											<td>[经典老片]移动城堡</td>
										</tr>
										<tr>
											<td>[经典老片]移动城堡</td>
											<td>[经典老片]移动城堡</td>
										</tr>
										<tr>
											<td>[经典老片]移动城堡</td>
											<td>[经典老片]移动城堡</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		<%} %>
		</td>
	</tr>
</table>

⌨️ 快捷键说明

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