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

📄 index.jsp

📁 自己写的一个网络日志(BLOG)系统
💻 JSP
字号:
<%@ page language="java"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="blog.*"%>
<%@ page import="java.util.*"%>
<%-- 

//   index.jsp
//   网站首页
//
 --%>
<HTML>
<HEAD>
<TITLE>Java Coffee-Touch The Dream</TITLE>
<LINK rev=stylesheet media=screen href="css/coffee.css" type=text/css
	rel=stylesheet>
<LINK rev=stylesheet media=print href="css/print.css" type=text/css
	rel=stylesheet>
<SCRIPT language=JavaScript type=text/javascript>
	var str00="http://localhost/Blog/";
	var str01="名称或邮箱不能为空";
	var str02="名称或邮箱格式不对";
	var str03="留言不能为空或过长";
	var str06="显示UBB表情>>";
	var intMaxLen="1000";
</SCRIPT>
</HEAD>
<BODY class=single>
<%
request.setCharacterEncoding("gbk");
ArrayList artList = null;
ArrayList cataList= null;
CArtDAO  artDao = CArtDAO.newInstance();
artList = artDao.executeQuery();
int realNum = 0;

CCataDAO cataDao = CCataDAO.newInstance();
cataList= cataDao.executeQuery();

%>


<DIV id=divAll>
<DIV id=divPage>
<DIV id=divMiddle>
<DIV id=divTop>
<H1 id=BlogTitle><A href="index.jsp">Java Coffee</A></H1>
<H2 id=BlogSubTitle>欢迎您访问我的个人blog!</H2>
</DIV>
<DIV id=divNavBar>
<H3>导航</H3>
<UL>
	<LI><A href="index.jsp">Index</A></LI>
	<LI><A href="#">Search</A></LI>
	<LI><A href="login.jsp">Admin</A></LI>
</UL>
</DIV>

<DIV id=divMain><%
if(artList != null){
	realNum = artList.size();
	int artNum = 0;
	if(artList.size()<=5){
		artNum = artList.size();
	}else{
		artNum = 5;
	}
	for(int i = 0; i<artNum;i++){
		CArticle article = new CArticle();
		article = (CArticle)artList.get(i);
		out.println("<DIV class=\"post cate1 auth1\">");
		out.println("<H4 class=post-date>"+article.getPostYear()+"/"+article.getPostMonth()+"/"+article.getPostDay()+" "+article.getPostTime()+"</H4>");
		out.println("<H2 class=post-title><A href=\"viewarticle.jsp?artID="+article.getArtID()+"\">"+article.getArtTitle()+"</A></H2>");
		out.println("<DIV class=post-body>"+CStringEncoder.htmlEncoder(article.getArtContent())+"</DIV>");
		CUserDAO userDao = CUserDAO.newInstance();
		String userName = userDao.queryByID(article.getUserID());
		
		String cataName = cataDao.queryByID(article.getCataID());
		out.println("<H6 class=post-footer>发布:"+userName+" | 分类:"+cataName+" | 评论:0 | 引用:0</H6>");
		out.println("</DIV>");
	}
	out.println("<DIV class=\"post pagebar\"><A href=\"contactservlet?jumpPage=1\">浏览所有"+artList.size()+"篇日志</A></DIV>");
}else{
	out.println("<DIV class=\"post pagebar\">没有任何已写的blog日志</DIV>");
}

%></DIV>
<DIV id=divSidebar>
<DIV class=function id=divCalendar>
<H3>日历</H3>
<%
GregorianCalendar gCal = new GregorianCalendar() ;
CCalendar cal = new CCalendar(gCal);
String strCal = cal.makeCalendar();
out.println(strCal);
%>
</DIV>
<DIV class=function id=divContorPanel>
<H3>控制面板</H3>
<UL>
	<LI><A href="login.jsp">[管理登陆]</A>&nbsp;&nbsp;<A
		href="#">[查看权限]</A></LI>
</UL>
</DIV>
<DIV class=function id=divCatalog>
<H3>网站目录</H3>
<UL>
	<%
if(cataList != null){
	for(int i = 0;i<cataList.size();i++){
		CCatalog catalog = new CCatalog();
		catalog = (CCatalog)cataList.get(i);
		out.println("<LI><A href=\"contactservlet?jumpPage=1&cata="+catalog.getCataID()+"\">"+catalog.getCataName()+"</A>");
	}
}
%>
</UL>
</DIV>
<DIV class=function id=divSearchPanel>
<H3>Search</H3>
<UL>
	<LI>
	<FORM action=# method=post><INPUT
		id=edtSearch size=12 name=edtSearch> <INPUT id=btnPost type=submit
		value=提交 name=btnPost></FORM>
	</LI>
</UL>
</DIV>
<DIV class=function id=divStatistics>
<H3>站点统计</H3>
<UL>
	<LI>文章总数:<%=realNum %>
	<LI>当前语言:zh-CN</LI>
</UL>
</DIV>
<DIV class=function id=divFavorites>
<H3>网站收藏</H3>

<UL>
	<li><a href="http://www.rainbowsoft.org/" target="_blank">RainbowSoft
	Studio</a></li>

</UL>
</DIV>
<DIV class=function id=divLinkage>
<H3>友情链接</H3>
<UL>
	<LI><A href="http://www.rainbowsoft.org/zblog/" target=_blank>布罗格的烘培机</A>
	</LI>
</UL>
</DIV>
<DIV class=function id=divMisc>
<H3>图标汇集</H3>
<UL>

	<LI><A href="http://www.apache.org/" target=_blank> <IMG height=15
		alt="本站采用apache 服务器" src="images/apache.gif" width=80 border=0></A>
	<LI><A href="http://www.mozilla.org/" target=_blank> <IMG height=15
		alt="本站为 Mozilla 进行了优化,推荐使用 Mozilla FireFox" src="images/firefox.png"
		width=80 border=0></A>
	<LI><A href="http://validator.w3.org/check?uri=referer" target=_blank>
	<IMG height=15 alt="通过 W3C XHTML 1.0 Transitional 校验"
		src="images/w3c_xhtml.gif" width=69 border=0></A>
	<LI><A href="http://jigsaw.w3.org/css-validator/check/referer"
		target=_blank> <IMG height=15 alt="通过 W3C CSS 校验"
		src="images/w3c_css.gif" width=56 border=0></A></LI>
</UL>
</DIV>
</DIV>
<DIV id=divBottom>
<H2 id=BlogCopyRight>Copyright 2005-2008 LeToN.com. LeToNRights
Reserved.</H2>
</DIV>
</DIV>
</DIV>
</DIV>
</BODY>
</HTML>

⌨️ 快捷键说明

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