首页 > 编程学习 > 在线考试系统(4)——学生端主页设计

在线考试系统(4)——学生端主页设计

发布时间:2022/12/10 18:04:38

目录

 

1.把主页分成4个部分

1.1 head.jsp

1.2 menu.jsp

1.3 default.jsp

1.4 foot.jsp

2.main.jsp主页设计

3.测试


​​​​​​​

1.把主页分成4个部分

1.1 head.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div align="center"><div style="background: url('${pageContext.request.contextPath}/image/banner.jpg');height:90px;width:1000px;float:right;" ><font style="float: right;padding: 65px 20px 20px 10px;">欢迎:<strong>${currentUser.name }</strong></font></div>
</div>

1.2 menu.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div class="navbar"><div class="navbar-inner"><a class="brand" href="main.jsp">首页</a><ul class="nav"><li><a href="#">在线考试</a></li><li><a href="#">成绩查询</a></li><li><a href="#">修改密码</a></li><li><a href="#">退出系统</a></li></ul></div>
</div>

1.3 default.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div class="defaultPage"><p>欢迎使用!</p>
</div>

1.4 foot.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<div align="center"><div class="foot">Copyright  版权所有</div>
</div>

 

2.main.jsp主页设计

<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生端主页</title>
<link href="${pageContext.request.contextPath}/style/exam.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
</head>
<%//这里对mainPage做特殊处理String mainPage=(String)request.getAttribute("mainPage");//如果后台没有传来数据,则使用默认default页if(mainPage==null || mainPage.equals("")){mainPage="common/default.jsp";}
%>
<body>
<table width="1000px" align="center"><tr><td><jsp:include page="common/head.jsp"></jsp:include></td></tr><tr><td><jsp:include page="common/menu.jsp"></jsp:include></td></tr><tr><td><!-- mainPage内容是动态的 --><jsp:include page="<%=mainPage %>"></jsp:include></td></tr><tr><td><jsp:include page="common/foot.jsp"></jsp:include></td></tr>
</table>
</body>
</html>

 

3.测试

我们在登录界面进行登录:

 

登录成功后会跳到main.jsp页面:

 

 则显示成功!

 

 

 

 


本文链接:https://www.ngui.cc/zz/1569119.html
Copyright © 2010-2022 ngui.cc 版权所有 |关于我们| 联系方式| 豫B2-20100000