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

📄 news.jsp

📁 《JSP通用模块及典型系统开发实例导航》源代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="include.jsp"%>
<HTML>
<HEAD>
<TITLE><%=title%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<LINK href="css/css.css" rel=stylesheet type=text/css>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 text=#000000 topMargin=0>
<script Language="JavaScript">
<!--
function isspacestring(mystring)
{ var istring=mystring;
  var temp,i,strlen;
  temp=true;
  strlen=istring.length;
  for (i=0;i<strlen;i++)
  {
    if ((istring.substring(i,i+1)!=" ")&(temp))
     { temp=false;  }
  }
 return temp;
}

function firstisspace(mystring)
{ var istring=mystring;
  var temp,i,strlen;
  temp=false;
    if (istring.substring(0,1)==" ")
     { temp=true;  }
 return temp;
}

function check_input(theForm)
{

   if ((theForm.content.value == "")|(firstisspace(theForm.content.value)))
  {
    alert("请输入查询的条件.不能以空格开头");
    theForm.content.focus();
    return (false);
  }

  if ((theForm.content.value == "")|(isspacestring(theForm.content.value)))
  {
    alert("请输入查询的条件.");
    theForm.content.focus();
    return (false);
  }
}
//-->
</script>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=81 width=776>
	<TBODY>
		<TR>
			<TD width=776>
			<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
				<TBODY>
					<TR>
						<TD background="img/index/b-banner.jpg" height="83" width="100%"><IMG
							SRC="img/index/ban.jpg" WIDTH="340" HEIGHT="83" BORDER="0"></TD>
					</TR>
					<TR>
						<TD height=23>
						<TABLE border=0 cellPadding=0 cellSpacing=0 class=font-12
							height="100%" width="100%" background="img/index/nav1.jpg">
							<TBODY>
								<TR>
									<TD align=middle width=50><A class=w href="index.jsp">首 页</A></TD>
									<%CategoryMgr categoryMgr = new CategoryMgr();
			Collection c = categoryMgr.getAll();
			Iterator iterator = c.iterator();
			while (iterator.hasNext()) {
				Category category = (Category) iterator.next();

				%>
									<TD align=middle width=50><A class=w
										href="list.jsp?id=<%=category.getId()%>"><%=category.getName()%></A></TD>
									<%}%>
								</TR>
							</TBODY>
						</TABLE>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
			</TD>
		</TR>
	</TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=26 width=776>
	<TBODY>
		<TR>
			<TD background="img/index/nav.jpg" vAlign=center>
			<TABLE align=center border=0 cellPadding=0 cellSpacing=0
				style="FONT-SIZE: 12px" width="100%">
				<FORM action="search.jsp" method=post name=form1
					onsubmit="return check_input(this)">
				<TBODY>
					<TR>
						<TD align=middle vAlign=center width=170><SCRIPT
							language=JavaScript>
  					today=new Date();                                                                                      function initArray(){
						this.length=initArray.arguments.length
						for(var i=0;i<this.length;i++)
						this[i+1]=initArray.arguments[i] }
						var d=new initArray("<font color=RED>星期日</font>","星期一","星期二","星期三","星期四","星期五","<font color=GREEN>星期六</font></font>"); document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日"," ",d[today.getDay()+1]);
   					</SCRIPT></TD>
						<TD align=middle width=322>&nbsp;</TD>
						<TD align=middle width=284>本站搜索: <INPUT name=content size=16
							style="FONT-SIZE: 12px"><INPUT name=Submit type=submit value=GO></TD>
					</TR>
				</FORM>
	</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=776>
	<TBODY>
		<TR>
			<TD bgColor=#999999>&nbsp;</TD>
			<TD width=180><IMG border=0 height=22 src="img/index/code-top.gif"
				width=180></TD>
		</TR>
	</TBODY>
</TABLE>
<TABLE border=0 cellPadding=3 cellSpacing=0 width=776>
	<TBODY>
		<TR bgColor=#996633>
			<TD colSpan=4 height=5></TD>
		</TR>
		<TR>
			<TD align=middle bgColor=#eeeeee rowSpan=2 vAlign=top width=20></TD>
			<TD align=middle rowSpan=2 vAlign=top>
			<TABLE border=0 cellPadding=3 width="100%">
				<TBODY>
					<TR align=middle>
						<%int id = (null == request.getParameter("id") ? 1 : (Integer
					.parseInt(request.getParameter("id"))));
			NewsMgr newsMgr = new NewsMgr();
			News news = newsMgr.getById(id);
			newsMgr.addhits(id);%>
						<TD><FONT SIZE="3"><B><%=news.getTopic()%></B></FONT></TD>
					</TR>
					<TR>
						<TD align=center><%String picture = news.getPicture();
			if (picture == null || picture.indexOf('/', 0) == -1) {
				out.println("&nbsp;");
			} else {
				out.println("<IMG SRC='" + news.getPicture() + "' BORDER='0'>");
			}%></TD>
					</TR>
					<TR>
						<TD><%=news.getContent()%></TD>
					</TR>
				</TBODY>
			</TABLE>
			</TD>
			<TD align=middle bgColor=#996633 rowSpan=2 vAlign=top width=180>
			<TABLE border=0 cellPadding=0 cellSpacing=0 width=170>
				<TBODY>
					<TR>
						<TD><IMG height=20 src="img/index/2002.gif" width=170></TD>
					</TR>
					<TR>
						<TD bgColor=#333333>
						<TABLE border=0 cellPadding=3 width="100%">
							<TBODY>
								<TR>
									<TD><%Collection c2 = newsMgr.getAllByHitsDesc();
			Iterator iterator2 = c2.iterator();
			int j = 1;
			while (iterator2.hasNext()) {
				news = (News) iterator2.next();
				if (j > 9)
					continue;

				j++;

				%> <FONT color=#ffffff>■ <A class=w
										href="news.jsp?id=<%=news.getId()%>" target=_blank
										title=<%=news.getTopic()%>> <%if (news.getTopic().length() > 30)
					out.println(news.getTopic().substring(0, 30) + "...");
				else
					out.println(news.getTopic());%></A></FONT><BR><FONT color=#ffffff>
									<%}%> </FONT><BR>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
						</TD>
					</TR>
					<TR>
						<TD><IMG height=20 src="img/index/2001.gif" width=170></TD>
					</TR>
				</TBODY>
			</TABLE>
			</TD>
		</TR>
	</TBODY>
</TABLE>
<TABLE bgColor=#eeeeee border=0 height=108 width=776>
	<TBODY>
		<TR>
			<TD align=middle><%@ include file="foot.jsp"%></TD>
		</TR>
	</TBODY>
</TABLE>
</CENTER>
</BODY>
</HTML>

⌨️ 快捷键说明

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