基于javaweb的SSM精品开放课程教学网站的开发与实现(包含视频在线课程\作业上传下载批改\留言\自测\题库+教师学生管理员三种权限)

目录

0、效果展示

1、精品课程教学平台概述

2、精品课程教学平台搭建环境

3、项目代码规划结构

 ​5、后端代码示例

6、前端代码示例

 


 

0、效果展示

前台学生和教师界面

 

后台管理员界面

 

1、精品课程教学平台概述
 

在线教育分为四阶段:

第一阶段 通过网站学生提供课程资料一般体现为上传下载方式;


第二阶段 同样通过网站,除了第一阶段内容外,还可通过电子邮件、公告栏、网上题库、留言板、在线答疑实现双向异步沟通交流学习;

第三阶段 在第一阶段和第二阶段网站基础上,可以通过手机APP、微信群、视频会议等多种形式, 进行同步双向实时交流学习。

第四阶段 由于新冠肺炎疫情影响下的在线直播课程,更是将互联网与线上教学与评价推向了新的高度

 

2、精品课程教学平台搭建环境

本文以实现一个线上精品课程教学课程为目标,从环境搭建到编码实现全过程讲述

主要实现目标

教师端在线发布上传课程资料,发布课程作业,批阅作业,发布在线测试题库

学生端在线学习课程,并下载资料,可在线测试,在线上传作业

管理员管理里学生和教师用户,以及审核相关的课程资料和留言互动信息

 

我们使用javaweb、J2EE来构建精品课程教学平台,环境使用最新版jdk和tomcat,配合mysql数据库

开发工具使用idea(也可以使用eclipse),数据库管理工具使用Navicat Premium 

开发框架使用JavaBean Servlet MVC结构;

没有使用SSH(Struts+Spring+Hibernate)或SSM(Spring+SpringMVC+MyBatis),这两个框架我们在别的项目中再介绍开发过程

 

在项目中会引入My97DatePicker作为前端日期时间选择工具,使用fckeditor作为富媒体编辑器(也可以使用百度的ueditor)

 

 

使用DWR(Direct Web Remoting)用于改善web页面与Java类交互,实现远程服务器端AJAX读取登录数据。

使用JSTL(Java server pages standarded tag library,即JSP标准标签库),此库是由JCP(Java community Proces)所制定的标准规范,它主要提供给Java Web开发人员一个标准通用的标签库,并由Apache的Jakarta小组来维护。开发人员可以利用这些标签取代JSP页面上的Java代码,从而提高程序的可读性,降低程序的维护难度。

 

3、项目代码规划结构


 
 

SRC目录为后端JAVA代码,分别包含action控制逻辑(以实体分文件命名),   dao数据库连接代码,    orm实体,service,util常用代码包含编码转换,md5加密等

webroot目录为前端代码按角色划分文件命名:admin包含管理员功能代码,qiantai包含学生和教师功能代码,

 

5、后端代码示例

adminaction.java管理员控制代码

package com.action;

import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.DB;
import com.orm.TAdmin;

public class admin_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
		
		if(type.endsWith("adminMana"))
		{
			adminMana(req, res);
		}
		if(type.endsWith("adminAdd"))
		{
			adminAdd(req, res);
		}
		if(type.endsWith("adminDel"))
		{
			adminDel(req, res);
		}
		if(type.endsWith("adminedit"))
		{
			adminedit(req, res);
		}
		if(type.endsWith("adminsaveedit"))
		{
			adminsaveedit(req, res);
		}
	}
	
	
	//管理员管理
	public void adminMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		List adminList=new ArrayList();
		String sql="select * from t_admin";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				TAdmin admin=new TAdmin();
				admin.setUserId(rs.getInt("userId"));
				admin.setUserName(rs.getString("userName"));
				admin.setUserPw(rs.getString("userPw"));
				adminList.add(admin);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("adminList", adminList);
		req.getRequestDispatcher("admin/admin/adminMana.jsp").forward(req, res);
	}
	
	//管理员显示编辑页面
	public void adminedit(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		System.out.println(req.getParameter("userId")+"**");



		List adminList=new ArrayList();
		String sql="select * from t_admin where userId="+Integer.parseInt(req.getParameter("userId"));
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				TAdmin admin=new TAdmin();
				admin.setUserId(rs.getInt("userId"));
				admin.setUserName(rs.getString("userName"));
				admin.setUserPw(rs.getString("userPw"));
				adminList.add(admin);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("adminList", adminList);
	
		req.getRequestDispatcher("admin/admin/adminedit.jsp").forward(req, res);
	}
	
	//管理员保存添加的内容 
	public void adminAdd(HttpServletRequest req,HttpServletResponse res)
	{
		String userName=req.getParameter("userName");
		String userPw=req.getParameter("userPw");
		String sql="insert into t_admin values(?,?,?)";
		Object[] params={null,userName,userPw};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("message", "操作成功");
		req.setAttribute("path", "admin?type=adminMana");
		
        String targetURL = "/common/success.jsp";
		dispatch(targetURL, req, res);
	}
	
	
	//管理员删除
	public void adminDel(HttpServletRequest req,HttpServletResponse res)
	{
		System.out.println(req.getParameter("userId")+"**");
		String sql="delete from t_admin where userId="+Integer.parseInt(req.getParameter("userId"));
		Object[] params={};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("message", "操作成功");
		req.setAttribute("path", "admin?type=adminMana");
		
        String targetURL = "/common/success.jsp";
		dispatch(targetURL, req, res);
	}
	
	
	//管理员保存编辑的内容 
	public void adminsaveedit(HttpServletRequest req,HttpServletResponse res)
	{
		String sql="update t_admin set username='"+req.getParameter("userName")+"' where userid="+Integer.parseInt(req.getParameter("userId"));
		Object[] params={};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("message", "操作成功");
		req.setAttribute("path", "admin?type=adminMana");
		
        String targetURL = "/common/success.jsp";
		dispatch(targetURL, req, res);
	}

	public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response) 
	{
		RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
		try 
		{
		    dispatch.forward(request, response);
		    return;
		} 
		catch (ServletException e) 
		{
                    e.printStackTrace();
		} 
		catch (IOException e) 
		{
			
		    e.printStackTrace();
		}
	}
	public void init(ServletConfig config) throws ServletException 
	{
		super.init(config);
	}
	
	public void destroy() 
	{
		
	}
}

 

db.java数据库连接代码

package com.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DB
{
	private Connection con;

	private PreparedStatement pstm;

	 
	
	
	private String user = "root";

	//private String password = "root";//这里修改数据库密码    
	private String password = "root";//这里修改数据库密码     //这里修改数据库密码  


	private String className = "com.mysql.jdbc.Driver";

	private String url = "jdbc:mysql://127.0.0.1:3306/db_jpkc?characterEncoding=utf8";

	public DB()
	{
		try
		{
			Class.forName(className);
		} catch (ClassNotFoundException e)
		{
			System.out.println("加载数据库驱动失败!");
			e.printStackTrace();
		}
	}

	/** 创建数据库连接 */
	public Connection getCon()
	{
		try
		{
			con = DriverManager.getConnection(url, user, password);
		} catch (SQLException e)
		{
			System.out.println("创建数据库连接失败!");
			con = null;
			e.printStackTrace();
		}
		return con;
	}

	public void doPstm(String sql, Object[] params)
	{
		if (sql != null && !sql.equals(""))
		{
			if (params == null)
				params = new Object[0];

			getCon();
			if (con != null)
			{
				try
				{
					System.out.println(sql);
					pstm = con.prepareStatement(sql,
							ResultSet.TYPE_SCROLL_INSENSITIVE,
							ResultSet.CONCUR_READ_ONLY);
					for (int i = 0; i < params.length; i++)
					{
						pstm.setObject(i + 1, params[i]);
					}
					pstm.execute();
				} catch (SQLException e)
				{
					System.out.println("doPstm()方法出错!");
					e.printStackTrace();
				}
			}
		}
	}

	public ResultSet getRs() throws SQLException
	{
		return pstm.getResultSet();
	}

	public int getCount() throws SQLException
	{
		return pstm.getUpdateCount();
	}

	public void closed()
	{
		try
		{
			if (pstm != null)
				pstm.close();
		} catch (SQLException e)
		{
			System.out.println("关闭pstm对象失败!");
			e.printStackTrace();
		}
		try
		{
			if (con != null)
			{
				con.close();
			}
		} catch (SQLException e)
		{
			System.out.println("关闭con对象失败!");
			e.printStackTrace();
		}
	}
}

 

 

tadmin.java数据库实体

package com.orm;

public class TAdmin
{
	private int userId;
	
	private String userName;

	private String userPw;

	public String getUserName()
	{
		return userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	public String getUserPw()
	{
		return userPw;
	}

	public void setUserPw(String userPw)
	{
		this.userPw = userPw;
	}

	public int getUserId()
	{
		return userId;
	}

	public void setUserId(int userId)
	{
		this.userId = userId;
	}

}

 

 

loginservice.java登录dwr ajax后端代码

package com.service;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;


import com.dao.DB;
import com.orm.TAdmin;
import com.orm.Tbanji;
import com.orm.Tstu;
import com.orm.Ttea;
import com.orm.Tzhuanye;
import com.orm.Tkecheng;

public class loginService
{
	public String login(String userName,String userPw,int userType)
	{
		try
		{
			Thread.sleep(700);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		String result="no";
		
		if(userType==0)//系统管理员登陆
		{
			String sql="select * from t_admin where userName=? and userPw=?";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			mydb.doPstm(sql, params);
			try 
			{
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					 result="no";
				}
				else
				{
					 result="yes";
					 TAdmin admin=new TAdmin();
					 admin.setUserId(rs.getInt("userId"));
					 admin.setUserName(rs.getString("userName"));
					 admin.setUserPw(rs.getString("userPw"));
					 WebContext ctx = WebContextFactory.get(); 
					 HttpSession session=ctx.getSession(); 
					// session.setAttribute("userType", 0);
		             session.setAttribute("admin", admin);
				}
				rs.close();
			} 
			catch (SQLException e)
			{
				System.out.println("登录失败!");
				e.printStackTrace();
			}
			finally
			{
				mydb.closed();
			}
			
		}
		
		
		if(userType==1)
		{
			String sql="select * from t_tea where bianhao=? and loginpw=?";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			mydb.doPstm(sql, params);
			try 
			{
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					 result="no";
				}
				else
				{
					 result="yes";
					 
					 Ttea tea=new Ttea();
				     tea.setId(rs.getInt("id"));
					 tea.setBianhao(rs.getString("bianhao"));
					 tea.setName(rs.getString("name"));
					 tea.setSex(rs.getString("sex"));
					 tea.setAge(rs.getString("age"));
					 tea.setLoginpw(rs.getString("loginpw"));
						
					 WebContext ctx = WebContextFactory.get(); 
					 HttpSession session=ctx.getSession(); 
					 session.setAttribute("userType", 1);
		             session.setAttribute("tea", tea);
				}
				rs.close();
			} 
			catch (SQLException e)
			{
				System.out.println("登录失败!");
				e.printStackTrace();
			}
			finally
			{
				mydb.closed();
			}
		}
		if(userType==2)
		{
			String sql="select * from t_stu where xuehao=? and loginpw=?";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			mydb.doPstm(sql, params);
			try 
			{
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					 result="no";
				}
				else
				{
					 result="yes";
					 
					 Tstu stu=new Tstu();
					 stu.setId(rs.getInt("id"));
					 stu.setXuehao(rs.getString("xuehao"));
					 stu.setName1(rs.getString("name1"));
					 stu.setSex(rs.getString("sex"));
					 stu.setAge(rs.getString("age"));
					 stu.setBanji_id(rs.getInt("banji_id"));
					 stu.setLoginpw(rs.getString("loginpw"));
						
					 WebContext ctx = WebContextFactory.get(); 
					 HttpSession session=ctx.getSession(); 
					 session.setAttribute("userType", 2);
		             session.setAttribute("stu", stu);
				}
				rs.close();
			} 
			catch (SQLException e)
			{
				System.out.println("登录失败!");
				e.printStackTrace();
			}
			finally
			{
				mydb.closed();
			}
		}
		return result;
	}

    public String adminPwEdit(String userPwNew)
    {
		System.out.println("DDDD");
    	try 
		{
			Thread.sleep(700);
		} 
		catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		WebContext ctx = WebContextFactory.get(); 
		HttpSession session=ctx.getSession(); 
		TAdmin admin=(TAdmin)session.getAttribute("admin");
		
		String sql="update t_admin set userPw=? where userId=?";
		Object[] params={userPwNew,admin.getUserId()};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		
		return "yes";
    }
    
     public List zhuanyeAll()
    {
    	try
		{
			Thread.sleep(700);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	List zhuanyeList=new ArrayList();
		String sql="select * from t_zhuanye where del='no'";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				Tzhuanye zhuanye=new Tzhuanye();
				zhuanye.setId(rs.getInt("id"));
				zhuanye.setName(rs.getString("name"));
				zhuanye.setJieshao(rs.getString("jieshao"));
				zhuanyeList.add(zhuanye);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		return zhuanyeList;
    }
     
     public List kechengAll()
     {
     	try
 		{
 			Thread.sleep(700);
 		} catch (InterruptedException e)
 		{
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
     	
     	List kechengList=new ArrayList();
 		String sql="select * from t_kecheng where del='no'";
 		Object[] params={};
 		DB mydb=new DB();
 		try
 		{
 			mydb.doPstm(sql, params);
 			ResultSet rs=mydb.getRs();
 			while(rs.next())
 			{
 				Tkecheng kecheng=new Tkecheng();
 				kecheng.setId(rs.getInt("id"));
 				kecheng.setName(rs.getString("name"));
 				kecheng.setJieshao(rs.getString("jieshao"));
 				kechengList.add(kecheng);
 		    }
 			rs.close();
 		}
 		catch(Exception e)
 		{
 			e.printStackTrace();
 		}
 		mydb.closed();
 		return kechengList;
     }
   
    public List banjiAll()
    {
    	try
		{
			Thread.sleep(700);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	List banjiList=new ArrayList();
		String sql="select * from t_banji where del='no'";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				Tbanji banji=new Tbanji();
				banji.setId(rs.getInt("id"));
				banji.setName(rs.getString("name"));
				banjiList.add(banji);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		return banjiList;
    }


    public List stuAll()
    {
    	try
		{
			Thread.sleep(700);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	List stuList=new ArrayList();
		String sql="select * from t_stu where del='no'";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				Tstu stu=new Tstu();
				stu.setId(rs.getInt("id"));
				stu.setXuehao(rs.getString("xuehao"));
				stuList.add(stu);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		return stuList;
    }

    
    public List teaAll()
    {
    	try
		{
			Thread.sleep(700);
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	List teaList=new ArrayList();
		String sql="select * from t_tea where del='no'";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				Ttea tea=new Ttea();
				tea.setId(rs.getInt("id"));
				tea.setName(rs.getString("name"));
				teaList.add(tea);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		return teaList;
    }
}

 

 

 

6、前端代码示例

 

login.jsp管理员登录

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>






<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>课程教学互动网站-后台登录</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-image: url(images/main_top_bj2.jpg);}
	INPUT.smallInput {
	BORDER-RIGHT: solid #3D71BA 1px; BORDER-TOP: solid #3D71BA 1px; FONT-WEIGHT: normal; FONT-SIZE: 9pt; BORDER-LEFT: solid #3D71BA 1px; LINE-HEIGHT: normal; BORDER-BOTTOM:solid #3D71BA 1px; FONT-STYLE: normal; HEIGHT: 15px; FONT-VARIANT: normal

}
-->
</style>



		<script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
        <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
        <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
        
		<script language="javascript">
		function check1()
		{                                                                                         
		     if(document.ThisForm.userName.value=="")
			 {
			 	alert("请输入用户名");
				document.ThisForm.userName.focus();
				return false;
			 }
			 if(document.ThisForm.userPw.value=="")
			 {
			 	alert("请输入密码");
				document.ThisForm.userPw.focus();
				return false;
			 }
			 document.getElementById("indicator").style.display="block";
			 loginService.login(document.ThisForm.userName.value,document.ThisForm.userPw.value,0,callback);
		}
		
		function callback(data)
		{
		    document.getElementById("indicator").style.display="none";
		    if(data=="no")
		    {
		        alert("用户名或密码错误");
		    }
		    if(data=="yes")
		    {
		        alert("通过验证,系统登录成功");
		        window.location.href="<%=path %>/loginSuccess.jsp";
		    }
		    
		}
	    </script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
 <FORM name="ThisForm" action="<%=path %>/adminLogin.action" method=post><table width="642" height="431" border="0" align="center" cellpadding="0" cellspacing="0" background="images/denglu.gif" style="margin-top:70px;background-repeat:no-repeat;">
  <tr>
    <td height="219" colspan="4">&nbsp;</td>
  </tr>
  <tr>
    <td height="13" colspan="4">&nbsp;</td>
  </tr>
  <tr>
    <td width="289" height="42">&nbsp;</td>
   <td width="220" valign="middle" style="padding:2px;"><input type="text" name="userName" maxlength="20" size="20" value="" style="width:150px;" class="smallInput"></td>
    <td width="79">&nbsp;</td>
    <td width="54" style="padding-top:0px; cursor:hand;">&nbsp;</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td valign="top" style="padding:2px;"><input type="password" name="userPw" maxlength="20" size="21" value="" style="width:150px;" class="smallInput"></td>
    <td>&nbsp;</td>
    <td style="padding-top:0px; cursor:hand;">&nbsp;</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td valign="top" style="padding:2px;font-size:12px;">&nbsp;</td>
    <td>&nbsp;</td>
    <td style="padding-top:0px; cursor:hand;">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4" align="center"><span style="padding-top:0px; cursor:hand; padding-right:3px;">
      <input name="button" type="button" class="button" id="Submit" value="登 陆" onClick="check1()"> 
      <img id="indicator" src="<%=path %>/images/loading.gif" style="display:none"/>
    </span><font color="#FF0000" style="font-size:12px"></font></td>
    </tr>
  <tr height="100">
    <td height="88" colspan="4">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>



























 

index.jsp前台首页

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
           function down1(fujianPath,fujianYuashiMing)
           {
               <c:if test="${sessionScope.userType==null}">
                  alert("请先登录");
               </c:if>
            
	            <c:if test="${sessionScope.userType!=null}">
	               var url="<%=path%>/updown/updown.jsp?fujianPath="+fujianPath+"&fujianYuashiMing="+fujianYuashiMing;
			       url=encodeURI(url); 
	               url=encodeURI(url); 
	               window.open(url,"_self");
	            </c:if>
           }
    </script>

<title>课程教学网站</title>
<link href="images/style.css" rel="stylesheet" type="text/css" />
<style>
.toplink a {
	padding: 0 10px 0 0px;
	font: bold 12px/24px Arial, Helvetica, sans-serif;
	color: #F30;
	text-decoration: none;
}

.toplink a:hover {
	color: #000;
	background-color: inherit;
}
</style>
<!--图片轮播-->
<style type="text/css">
.box {
	position: relative;
	width: 972px; /*轮播图框架宽*/
}

.cont {
	height: 340px; /*轮播图框架高*/
	overflow: hidden;
}

.cont img { /*图片尺寸*/
	width: 972px;
	height: 340px;
	border: 0
}

.item {
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	font-size: 40px; /*圆点大小 */
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	text-align: right;
	line-height: 30px;
	height: 30px; /*圆点背景*/
}

.item a {
	margin-right: 10px;
	cursor: pointer;
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

a.seld {
	
}

a.hide {
	display: none;
}
</style>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
	var n = 0;
	$(document).ready(function(){
		count=$(".cont a").length;//显示区域的内容长度
		$(".item a").click(function(){
			$(this).addClass("seld").siblings().removeClass("seld");	
			var _index=$(this).index();//分屏的数字索引
			$(".cont>a").eq(_index).fadeIn(300).siblings().fadeOut(300);
		});
		t = setInterval("showAuto()", 2000);//执行定义好的函数
		$(".box").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 2000);});/*当鼠标划向图片时终止定时器,离开时再调用定时器*/
	})
	function showAuto()
	{
		n = n >=(count - 1)?0: ++n;
		$(".item a").eq(n).trigger('click');
	}	
</script>
<!--图片轮播-->

</head>
<body>

	<!--main start -->



	<jsp:include flush="true" page="/qiantai/inc/incTop2.jsp"></jsp:include>
	<div id="main">
		<table width="100%" border="0" cellspacing="0">
			<tr>
				<td><div class="box">
						<div class="cont">
							<a href="163.com" target="_blank"><img style="border: 0" src="images/1.jpg" /></a> <a class="hide" target="_blank" href="163.com"><img style="border: 0" src="images/2.jpg" /></a> <a class="hide" target="_blank" href="163.com"><img style="border: 0" src="images/3.jpg"></a> <a class="hide" target="_blank" href="163.com"><img style="border: 0" src="images/4.jpg" /></a>
						</div>
						<div class="item">
							<a class="seld">·</a> <a>·</a> <a>·</a> <a>·</a>
						</div>
					</div></td>
			</tr>
		</table>
		<!--left panel start -->
		<div id="left">

			<jsp:include flush="true" page="/qiantai/inc/incLeft.jsp"></jsp:include>
		</div>
		<!--left panel end -->
		<!--right panel start -->
		<div id="right">
			<!--rightBotMain start -->
			<div id="rightBotMain">
				<!--best start -->
				<div id="best">
					<h2>
						<span>教学资料信息</span>
					</h2>
					<p class="bestTxt">


						<TABLE class=dragTable cellSpacing=0 cellPadding=0 width="100%" border=0>

							<c:forEach items="${requestScope.docList}" var="doc">




								<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
									<td bgcolor="#FFFFFF" align="left"><a href="<%=path %>/doc?type=docDetailQian&id=${doc.id}">${doc.title}</a></td>
									<td bgcolor="#FFFFFF" align="right">${doc.shijian}</td>
								</tr>
							</c:forEach>
						</TABLE>



					</p>
					<br class="spacer" />
				</div>
				<div id="best"  style="margin-top:10px">
					<h2>
						<span>最新作业</span>
					</h2>
					<p class="bestTxt">
						<table width="99%" border="0" cellpadding="1" cellspacing="0" bgcolor="#FFFFFF" align="center" style="margin-top: 8px">
							<tr align="center" bgcolor="#FAFAF1" height="22">
								<td>名称</td>
								<td>上传时间</td>
								<td>下载</td>
							</tr>
							<c:forEach items="${requestScope.zuoyeList}" var="zuoye">
								<tr align='center' bgcolor="#FFFFFF" height="30">
									<td align="left">${zuoye.mingcheng}</td>
									<td align="left">${zuoye.shijian}</td>
									<td align="center"><a href="#" onclick="down1('${zuoye.fujian}','${zuoye.fujianYuanshiming}')" style="font-size: 10px; color: red">down</a></td>
								</tr>
							</c:forEach>
						</table>
					</p>
					<br class="spacer" />
				</div>
				<!--best end -->
			</div>
			<!--rightBotMain end -->
			<!--last panel start -->
			<div id="last">
				 


 <div class="lastbox">
        <h2 >网站公告</h2>
				<ul>
					<c:forEach items="${sessionScope.gonggaoList}" var="gonggao">
						<li><a href="<%=path %>/gonggao?type=gonggaoDetailQian&id=${gonggao.id}"> ${gonggao.title} </a></li>

					</c:forEach>
				</ul>

</div>

 <div class="lastbox" style="margin-top:10px">
     
				<h2  >教学视频</h2>
				<ul>


					<c:forEach items="${sessionScope.shipinList}" var="shipin">
						<li><a href="<%=path %>/shipin?type=shipinDetailQian&id=${shipin.id}"> ${shipin.title} </a></li>

					</c:forEach>

				</ul>


</div>
			</div>
			<!--last panel end -->
			<br class="spacer" />
		</div>
		<!--right panel end -->
		<br class="spacer" />
	</div>
	<!--main end -->
	<!--footerMain start -->


	<jsp:include flush="true" page="/qiantai/inc/incFoot.jsp"></jsp:include>


	<!--footerMain end -->
</body>
</html>










 

 

 

  • 2
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

计算机程序设计开发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值