bodyhotmovies.jsp

来自「一个用struts tiles的在线影院web系统」· JSP 代码 · 共 68 行

JSP
68
字号
<%@ 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.*"%>
<%
// Build object cache key for hot movies list.
String cacheKey = "movies-hot-0-6";
Cache cache = Cache.getInstance();
Page chunk = (Page) cache.get(cacheKey);
if (chunk == null) {
	Movies movies = new Movies();
	chunk = movies.searchHotMovie(null, 0, 6);
	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);
	}
}
// Is the result empty?
boolean isEmptySet = chunk.getItems().size() < 1;
%>
<!-- bodyHotMovies.jsp -->
<table cellSpacing="0" cellPadding="1" width="100%" border="0">
	<tr>
		<td>
		<table cellSpacing="0" cellPadding="0" width="100%" border="0">
			<tr>
				<td width="50"><img src="<%= request.getContextPath() %>/images/01/title-right-hot-01.gif"></td>
				<td class="title0" width="100"
					background="<%= request.getContextPath() %>/images/01/title-right-hot-bg.gif">&nbsp;火热播映中</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"><img src="<%= request.getContextPath() %>/images/01/title-right-hot-03.gif"></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td>
		<%if (isEmptySet) { %><%-- 如果数目为空 --%>
		<table class="body1" cellSpacing="0" cellPadding="5" width="100%"
			bgColor="#ffaa33" border="0">
			<tr>
				<td align="center">影片数为空!</td>
			</tr>
		</table>
		<%} else { %>
		<table class="body1" cellSpacing="0" cellPadding="5" width="100%"
			bgColor="#ffaa33" border="0">
			<%
			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>
		<%} %>
		</td>
	</tr>
</table>

⌨️ 快捷键说明

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