📄 catalogpicturepreview.jsp
字号:
<?xml version="1.0" encoding="gb2312" ?><%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%>
<%@ page import="com.eline.wap.common.util.*,
com.eline.wap.catalog.model.*,
com.eline.wap.catalog.client.*,
com.eline.wap.resource.model.*,
com.eline.wap.resource.client.*"%>
<%
// 获取图片节点信息
int catalogId = StringUtils.getInt(request.getParameter("catalogId"), -1);
CatalogHelper ch = new CatalogHelper();
Item item = ch.getItem(catalogId);
// 如果不符合条件则跳到失败页面
if (!(item instanceof SingleItem) || ((SingleItem)item).getSingleAttribute() != SingleItem.SINGLE_PICTURE) {
response.sendRedirect(SiteUrls.getInstance().getProperty(SiteUrls.CATALOG_FAILURE));
return;}
// 获取图像资源信息
int pictureId = ((SingleItem)item).getResourceId();
PictureHelper ph = new PictureHelper();
Picture picture = ph.getPicture(pictureId);
// 如果失败
if (picture == null) {
response.sendRedirect(SiteUrls.getInstance().getProperty(SiteUrls.CATALOG_FAILURE));
return;
}
// 生成图像url
String imagePath = request.getContextPath()
+ AppSettings.getInstance().getProperty(AppKeys.UPLOAD_ROOT)
+ "/images/pictures" + picture.getOriginFile();
System.out.println("catalogPicturePreview.jsp.imagePath=" + imagePath);
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Insert title here</title>
<style type="text/css">
body, table, td, select, input { font-size: 9pt; font-family: SimSun; }
.button2w { width: 50px; }
</style>
<script language="javascript">
<!--
function buttonCancel_onclick() {
var dlgWnd = window;
if (window.parent != null)
dlgWnd = window.parent;
dlgWnd.close();
return true;
}
//-->
</script>
</head>
<body bottomMargin="0" bgcolor="#d4d0c8" leftMargin="0" topMargin="0" rightMargin="0">
<table cellspacing="1" cellpadding="0" width="400" border="0">
<tr>
<td valign="top">
<table style="border-right: darkgray 1px solid; border-top: darkgray 1px solid; border-left: darkgray 1px solid; border-bottom: darkgray 1px solid"
cellspacing="0" cellpadding="2" width="100%" border="0">
<tr>
<td style="border-bottom: darkgray 1px solid" colspan="2"><b>图像基本信息</b></td>
</tr>
<tr>
<td width="100">图片名称:</td>
<td><input type="text" name="TextName" size="25" value="<%=picture.getName() %>" readonly /></td>
</tr>
<tr>
<td>描述:</td>
<td><textarea name="TextDescription" rows="3" cols="25" readonly><%=picture.getDescription() %></textarea></td>
</tr>
</table>
<div style="font-size:5px"> </div>
<table style="border-right: darkgray 1px solid; border-top: darkgray 1px solid; border-left: darkgray 1px solid; border-bottom: darkgray 1px solid"
cellspacing="0" cellpadding="2" width="100%" border="0">
<tr>
<td style="border-bottom: darkgray 1px solid"><b>图片预览</b></td>
</tr>
<tr>
<td height="240">
<div
style="border-top-width: thin; border-left-width: thin; border-bottom-width: thin; overflow: auto; width: 396px; height: 236px; background-color: white; border-right-width: thin">
<img src="<%=imagePath %>" /></div>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="2" width="100%" border="0">
<tr>
<td align="center" height="30"><input class="button2w" type="button"
value="关闭" name="buttonCancel" onclick="return buttonCancel_onclick()" /></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -