1.项目数据库分析
用户表,主题表,内容表。
2.项目需求:
——在一个页面的基础上进行
3.页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- <%@taglib uri="http://java.sun.com/jsp/jstl/core "prefix="c" %> --%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>E家园首页</title> <!-- 引入index.css --> <link rel="stylesheet" type="text/css" href="css/index.css" /> <script type="text/javascript"> function register(){ var mycontent =document.getElementById("mycontent"); mycontent.style.display='none'; var myRegister =document.getElementById("myRegister") myRegister.style.display='block'; } </script> </head> <body> <div id="container"> <!-- head --> <div class="head"> <!-- logo start--> <div class="logo"><img src="img/logo.jpg"></div> <!-- nav --> <div class="nav"> <ul> <li><a href="#"><img src="img/daohan_1.jpg" /></a></li> <li><a href="#"><img src="img/daohan_2.jpg" /></a></li> <li><a href="#"><img src="img/daohan_3.jpg" /></a></li> <li><a href="#"><img src="img/daohan_4.jpg" /></a></li> <li><a href="#"><img src="img/daohan_5.jpg" /></a></li> <li><a href="#"><img src="img/daohan_6.jpg" /></a></li> <li><a href="#"><img src="img/daohan_7.jpg" /></a></li> </ul> </div> </div><!-- head END --> <!-- ====================================================================== --> <!-- main --> <div class="main"> <!-- main_left --> <div class="main_left"> <div class="myForm"> <img src="img/bg06.gif"> <!-- 登录表单 --> <div class="mysLogin"> <c:if test="${empty users }"> <div style = "text-align: center"> <form action ="doLogin.jsp" method ="post"> <p>账号<input type ="text" name = "username" style = "width:120px;"></p> <p>密码<input type ="password" name ="password" style = "width:120px;"></p> <input type = "image" src = "img/button01.gif"> <img src = "img/button02.gif"> </form> </div> </c:if> <c:if test ="${not empty users }"> 欢迎回来!${users.username} <button onclick="register()">个人中心</button> </c:if> </div> <!-- 分割线 --> <div class="division"> <img src="img/line01.gif" /> <img src="img/left01.jpg" /> </div> <!-- 登录表单 --> <div class="mysearch"></div> <img src="img/line02.gif" /> </div><!-- myForm END --> <div class="notice"> <img src="img/left02.gif" /> <div class="notice_content"> 站内公告<br> 站内公告<br>站内公告<br> 站内公告<br> 站内公告<br> </div> <img src="img/line02.gif" /> </div> </div> <!-- main_right --> <div class="main_right"> <div class="carousel"><img src="img/banner.gif"></div> <div class="mtitle"><img src="img/dot02.gif">栏目分类</div> <!-- 注册模块 --> <div id ="myRegister" style ="display: none"> <from> 用户名<input type ="text/"><br/> 密码<input type ="text/"><br/> 真实姓名<input type ="text/"><br/> 性别<input type ="text/"><br/> <input type ="submit" value ="注册"/> </from> </div> <!-- 显示内容模块 --> <div class="contents" id ="mycontend"> <div class="item"> <img src="img/cen01.jpg" /> <ul> <li>aaaaaaa</li> <li>aaaaaaa</li> <li>aaaaaaa</li> </ul> </div> <div class="item"> <img src="img/cen01.jpg" /> <ul> <li>aaaaaaa</li> <li>aaaaaaa</li> <li>aaaaaaa</li> </ul> </div> <div class="item"> <img src="img/cen01.jpg" /> <ul> <li>aaaaaaa</li> <li>aaaaaaa</li> <li>aaaaaaa</li> </ul> </div> <div class="item"> <img src="img/cen01.jpg" /> <ul> <li>aaaaaaa</li> <li>aaaaaaa</li> <li>aaaaaaa</li> </ul> </div> </div> </div> </div><!-- main END --> <!-- ====================================================================== --> <!-- footer start --> <div class="footer"> 版权所有 卓京信息<br> 盗版必究 </div><!-- footer end --> </div> </body> </html>