📄 view.jsp
字号:
<%@page language="java" contentType="text/html;charset=UTF-8" import="com.terac.album.*,com.terac.album.bean.*,java.text.SimpleDateFormat"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html locale="true">
<html:base/>
<%@ include file="_header.jsp" %>
<%
Photo photo=(Photo)request.getAttribute("photo");
Config cfg=(Config)application.getAttribute(Constants.ALBUM_CONFIG);
%>
<!-- navi begin -->
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tr>
<td bgcolor="#cccccc" height="1"></td>
</tr>
<tr>
<td height="30" bgcolor="#eeeeee">
<a href="list.do"><b><bean:message key="label.home" /></b></a> - <%=photo.getName()%>
</td>
</tr>
<tr>
<td bgcolor="#cccccc" height="1"></td>
</tr>
</table>
<br>
<!-- navi end -->
<table border="0" cellspacing="5" cellpadding="5" width="100%" align="center">
<tr>
<td align="center" colspan="2">
<br>
<%
String filename=cfg.getUploadDirectory()+"/"+photo.getFilename()+".jpg";
double scale =Util.cScale(photo.getWidth(), photo.getHeight(), 400, 400);
if (scale>1.0){
scale=1.0;
}
int newWidth=(int) (photo.getWidth() * scale);
int newHeight=(int) (photo.getHeight() * scale);
%>
<a href="<%=filename%>" target="_blank"><img src="<%=filename%>" border="0" width="<%=newWidth%>" height="<%=newHeight%>"></a></td>
</tr>
<tr>
<td class="p3" align="center" colspan="2">
<%=photo.getName()%><br>
<%=photo.getSize()%>K | <%=photo.getWidth()%>*<%=photo.getHeight()%><br>
<%=new SimpleDateFormat("yyyy-MM-dd HH:mm").format(photo.getUploadDate())%><br><br>
<%=photo.getDescription()%>
</td>
</tr>
</table>
<%@ include file="_footer.jsp" %>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -