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

📄 view.jsp

📁 在系统开发过程中用到了javabean和jsp技术
💻 JSP
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,java.io.*,oa.main.DealString,oa.main.ParentBean"%>
<html>
<head>
	<link href="../css/person.css" type=text/css rel=stylesheet>
<title>
	文章浏览
</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align=center>
<%

ParentBean pb = null;
oa.bean.ArticleBean myArtBean = null;
oa.bean.MenuBean myMenuBean = null;
oa.bean.MenuChildBean myMenuChildBean = null;
try{
pb = new ParentBean();
myArtBean = new oa.bean.ArticleBean();
myMenuBean = new oa.bean.MenuBean();
myMenuChildBean = new oa.bean.MenuChildBean(); 
DealString ds = new DealString();

String strtitle = "";
String strwriter= "";
String straddtime = "";
String content = "";
String menuname = "";
String whichtable = "";
String topicname = "";
String orgid = "";
String fromsite = "";
String keyword = "";
String hits = "";
String ftpfile = "";
String strhead = "";
String strgood = "";
String strimg = "";
String img = "";
String strAuthor = "";
String oldorgid="";
String strsee = ds.toString((String)request.getParameter("see"));
String editer = "";
String edittime = "";

if(!strsee.equals("00"))
{
	String strID = ds.toString((String)request.getParameter("id"));//文章编号
	String showorno = ds.toString((String)request.getParameter("show"));

	myArtBean.setID(strID);
	Hashtable hash = (Hashtable)myArtBean.getOneData();
	strtitle = (String)hash.get("TITLE");
	strwriter= (String)hash.get("WRITER");
	straddtime = (String)hash.get("ADDTIME");
	strwriter = pb.toName("zz_zgb","zgbh","xm",strwriter);

	menuname =(String)hash.get("MENUID");
	whichtable=(String)hash.get("WHICHTABLE");
	strAuthor = (String)hash.get("AUTHOR");

	if(whichtable.equals("1"))
	{
		myMenuBean.setID(Integer.parseInt(menuname));
		menuname = myMenuBean.toname();
	}
	if(whichtable.equals("0"))
	{
		myMenuChildBean.setID(Integer.parseInt(menuname));
		Hashtable hashid4 = (Hashtable)myMenuChildBean.getOneData();		
		Hashtable hashid3 = (Hashtable)myMenuChildBean.getID3();
		myMenuBean.setID(Integer.parseInt((String)hashid3.get("ID")));
		menuname = myMenuBean.toname()+"\\"+(String)hashid4.get("MENUCHILD");
	}
	
	topicname = (String)hash.get("TOPICID");
	topicname = myArtBean.toName("nb_topic","id","name",topicname);

	orgid = (String)hash.get("ORGID");
	oldorgid=(String)hash.get("OLDORGID");
	if(orgid.equals(""))
		orgid = "无";
	fromsite = (String)hash.get("FROMSITE");
	keyword = (String)hash.get("KEYWORD");
	hits = (String)hash.get("HITS");
	ftpfile = (String)hash.get("FTPFILE");
	strhead = (String)hash.get("IFHEAD");
	if(strhead.equals("0"))
		strhead = "否";
	else
		strhead = "是";
	strgood = (String)hash.get("IFGOOD");
	if(strgood.equals("0"))
		strgood = "否";
	else
		strgood = "是";
	strimg = (String)hash.get("IFIMG");
	if(strimg.equals("0"))
		strimg = "否";
	else
		strimg = "是";
	//img = "upload\\img\\"+(String)hash.get("IMG");
	img = "photo.jsp?photo="+(String)hash.get("IMG");
	editer = pb.toName("ZZ_ZGB","ZGBH","XM",(String)hash.get("EDITER"));
	edittime = (String)hash.get("EDITTIME");
	content = pb.QueryBLOB_JNDI("ARTICLE","ID="+strID,"CONTENT");

	
	//对于已经发布的文章进行特殊处理
	String confdir = oa.main.ParentBean.FilesPath;
	confdir = (new oa.main.DealString()).Replace(confdir,"\\","/");
	String ip = "http://"+request.getServerName();
	String port = request.getServerPort()+"";
	if(!port.equals("80"))ip+=":"+port;//"+confdir+"news/img/
	content = (new oa.main.DealString()).Replace(content,ip+"/oa/manage/upload/img/","photo.jsp?photo=");
	content = (new oa.main.DealString()).Replace(content,ip+"/oa/manage/upload/appendix/",confdir+"news/appendix/");
	content = (new oa.main.DealString()).Replace(content,"/temp_sure/","/downloadservlet?type=1&&filename=temp_sure/");

	ip = "http://10.0.0.92";
	content = (new oa.main.DealString()).Replace(content,ip+"/oa/manage/upload/img/","photo.jsp?photo=");
	content = (new oa.main.DealString()).Replace(content,ip+"/oa/manage/upload/appendix/",confdir+"news/appendix/");
	content = (new oa.main.DealString()).Replace(content,"/temp_sure/","/downloadservlet?type=1&&filename=temp_sure/");
%>
<table width="90%" border="0">
	<tr>
		<td height="40" align="center"><font style="font-size:16px"><b><%=strtitle%></b></font></td>
	</tr>
	<tr>
		<td align="right"><font color="#999999">编辑:<%=strAuthor%>&nbsp;&nbsp;发布时间:<%=straddtime%></font>
	</tr>
</table>
<%if(!showorno.equals("1")){%>
<table width="90%" border="0" bgcolor=#eeeeee>
	<tr>
		<td ><font color=#CC0066>版面:<%=menuname%></font></td>
	</tr>	
	<tr>
		<td ><font color=#CC0066>专题:<%=topicname%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>文章来源:<%=fromsite%></font></td>
	</tr>
	<tr>
		<!--td >鼠标提示信息:<%=hits%></td-->
		<td ><font color=#CC0066>发布者:<%=strwriter%></font></td>
	</tr>
<%if(!editer.equals("")){%>
	<tr>
		<!--td >鼠标提示信息:<%=hits%></td-->
		<td ><font color=#CC0066>审批者:<%=editer%></font></td>
	</tr>
	<tr>
		<!--td >鼠标提示信息:<%=hits%></td-->
		<td ><font color=#CC0066>审批时间:<%=edittime%></font></td>
	</tr>
<%}%>
	<tr>
		<td ><font color=#CC0066>关键字:<%=keyword%></font></td>
	</tr>
</table>
<table width="90%" border="0" bgcolor=#eeeeee>
	<tr>
<%
		//分割改过名的文件名串
		String[] newname=orgid.split(",");
		//分割未改过名的文件名串
		String[] newfile=oldorgid.split(",");
%>
		<td>
			<font color=#CC0066>附件:
<%
	for (int i=0;i<newname.length&&i<newfile.length;i++){
%>
			<a href="../../articledownloadservlet?newname=<%=newname[i]%>&newfile=<%=newfile[i]%>"><%=newfile[i]%></a></font>;
<%
	}
%>
		</td>
	</tr>
</table>
<table width="90%" border="0" bgcolor=#eeeeee>
	<tr>
		<td ><font color=#CC0066>下载的文件名:<%=ftpfile%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>发布到首页:<%=strhead%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>焦点:<%=strgood%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>图片新闻:<%=strimg%></font></td>
	</tr>
<%if(strimg.equals("是")){%>
	<tr >
		<td ><font color=#CC0066>首页图片:</font></td>
	</tr>
	<tr >
		<td ><img src="<%=img%>" height=200 width=200 border=0></td>	
	</tr>
<%}%>
</table>
<%}%>
<hr align=center width="96%" size=3 color="#cccccc">
<table width="90%" border="0" cellspacing=0 cellpadding=0 style="word-break:break-all;">
	<tr>
		<td width="100%"><p><%=content%></p></td>
	</tr>	
</table>
<hr align=center width="96%" size=3 color="#cccccc">
<%if(showorno.equals("1")){%>
<table width="90%" border="0" bgcolor=#eeeeee>
	<tr>
		<td ><font color=#CC0066>版面:<%=menuname%></font></td>
	</tr>	
	<tr>
		<td ><font color=#CC0066>专题:<%=topicname%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>文章来源:<%=fromsite%></font></td>
	</tr>
	<tr>
		<!--td >鼠标提示信息:<%=hits%></td-->
		<td ><font color=#CC0066>发布者:<%=strwriter%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>关键字:<%=keyword%></font></td>
	</tr>
	<tr>
<%
		//分割改过名的文件名串
		String[] newname=orgid.split(",");
		//分割未改过名的文件名串
		String[] newfile=oldorgid.split(",");
%>
		<td>
			<font color=#CC0066>附件:
<%
	for (int i=0;i<newname.length&&i<newfile.length;i++){
%>
			<a href="../../articledownloadservlet?newname=<%=newname[i]%>&newfile=<%=newfile[i]%>"><%=newfile[i]%></a></font>;
<%
	}
%>
		</td>
	</tr>
	<tr>
		<td ><font color=#CC0066>下载的文件名:<%=ftpfile%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>发布到首页:<%=strhead%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>焦点:<%=strgood%></font></td>
	</tr>
	<tr>
		<td ><font color=#CC0066>图片新闻:<%=strimg%></font></td>
	</tr>
<%if(strimg.equals("是")){%>
	<tr >
		<td ><font color=#CC0066>首页图片:</font></td>
	</tr>
	<tr >
		<td ><img src="<%=img%>" height=200 width=200 border=0></td>	
	</tr>
<%}%>
	<tr bgcolor="#aaccee">
		<td align=center><input type=button value="通过" onclick="fabiao('1');">&nbsp&nbsp<input type=button value="不通过" onclick="fabiao('2');">&nbsp&nbsp<input type=button value="取消" onclick="javascript:window.close();window.opener.focus();"></td>	
	</tr>	
</table>
<%}%>
<form name="formfb" action="" method=post>
</form>
<script>
function fabiao(id)
{
	if(id=='2')
	{
		document.all.formfb.action = "../../manageservlet?id=2&txt_type=11&txt_edit=3&txt_id=<%=strID%>";
		document.all.formfb.submit();
		window.opener.document.all.form1.submit();
	}
	if(id=='1')
	{
		document.all.formfb.action = "../../manageservlet?id=1&txt_type=11&txt_edit=3&txt_id=<%=strID%>";
		document.all.formfb.submit();
		window.opener.document.all.form1.submit();
	}
	window.close();
}
	
</script>

<%}
else
{
	strwriter= (String)session.getAttribute("zgbh");
	strwriter = pb.toName("zz_zgb","zgbh","xm",strwriter);
	straddtime = ds.getDateTime();
%>
<script>
	var author = window.opener.document.all.author.value;
	var wzly = window.opener.document.all.fromsite.value;
	if(author=="")
		author="<%=strwriter%>";
	document.write("<table width=\"85%\" border=\"0\">");
	document.write("<tr>");
	document.write("<td height=\"40\" align=\"center\" >");
	document.write("<font style=\"font-size:16px\"><b>");
	document.write(window.opener.document.all.Title.value);
	document.write("</b></font></td></tr>");
	document.write("<tr>");
	document.write("<td align=\"right\"><font color=\"#999999\">来源:");
	document.write(""+wzly+"&nbsp;");
	document.write("<font color=\"#CC0000\"></font>发布时间:");
	document.write("<%=straddtime%>");
	document.write("</font></td></tr></table>");
<%--
	document.write("<hr align=center width=\"96%\" size=3 color=\"#cccccc\">");
--%>
	document.write("<br><br>");
	document.write("<table width=\"90%\" border=\"0\" style='word-break:break-all'>");
	document.write("<tr>");
	document.write("<td align=left>");
	document.write(window.opener.document.all.Content.value);
	document.write("</td></tr>");
</script>
		  <tr><td align="left">(编辑:<script>document.write(author);</script>)</td><tr>
		  <tr><td align="left">(被访问次数:1)</td><tr>
	     <tr>
		    <td>
				<font class="bgword">附件:
<script>
		var fujian = window.opener.document.all.OLDORGID.value.split(",");
		if(fujian.length!=0)
			for(var i=0;i<fujian.length;i++)
				document.write("<a href='#'>"+fujian[i]+"; </a></font>");
		else
			document.write("没有附件");
</script>
			</td>
		 </tr>
<script>
	document.write("<tr><td align=center>");
	document.write("<input type=button value=\"返回\" onclick=\"javascript:window.close();\">");
	document.write("</td></tr></table>");
</script>
<%}
%>
</div>
</body>
</html>
<%}
finally{
	if(pb!=null)pb.closeConn();
	if(myArtBean!=null)myArtBean.closeConn();
	if(myMenuBean!=null)myMenuBean.closeConn();
	if(myMenuChildBean!=null)myMenuChildBean.closeConn();
}
%>

⌨️ 快捷键说明

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