目录
1 在线课程分享网站概述
课程网站管理系统主要分为前台用户和后台管理员。不同的用户有不同的权限。一般用户只能实现管理员指定的信息,系统管理员可以对整个系统进行操作。前台用户实现的功能有:登录、注册、修改登录密码、修改详细资料、我的课程管理、新闻、搜索、留言板;后台管理员实现的功能有:系统管理、公告管理、课程管理、注册会员管理
2 在线课程分享网站数据库表
表5 keheng课程
字段名称 | 自动增长 | 字段类型 | 说明 |
id | - | int | - |
title | - | varchar | 标题 |
url | - | varchar | 图片 |
address | - | varchar | 附件 |
linkman | - | varchar | 歌手 |
content | - | varchar | 内容 |
addtime | - | varchar | 日期 |
flag | - | varchar | 标志 |
type | - | int | 类型 |
erwei | - | varchar | 图片 |
userid | - | varchar | 用户Id |
表6 affiche公告
字段名称 | 自动增长 | 字段类型 | 说明 |
id | - | int | 编号 |
title | - | varchar | 标题 |
pic | - | varchar | 图片 |
content | - | varchar | 内容 |
addtime | - | datetime | 日期 |
adder | - | varchar | 发布人 |
表7 wendangclass课程分类
字段名称 | 自动增长 | 字段类型 | 说明 |
id | - | int | - |
title | - | varchar | 名称 |
3 在线课程分享网站关键代码
package com.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bean.kechengBean;
import com.util.Constant;
public class kechengactionServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public kechengactionServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response);
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(Constant.CHARACTERENCODING);
response.setContentType(Constant.CONTENTTYPE);
kechengBean tb=new kechengBean();
String method=request.getParameter("method").trim();
if(method.equals("delkecheng")){
String id=request.getParameter("id").trim();
int flag = tb.delkecheng(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
}
else if(method.equals("delkechengm")){
String id=request.getParameter("id").trim();
int flag = tb.delkecheng(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("hy_kecheng.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("hy_kecheng.jsp").forward(request, response);
}
}
else if(method.equals("hotdelkecheng")){
String id=request.getParameter("id").trim();
int flag = tb.delkecheng(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/kecheng/hot.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/kecheng/hot.jsp").forward(request, response);
}
}
else if(method.equals("hotkecheng")){
String id=request.getParameter("id").trim();
int flag = tb.hotkecheng(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
}
else if(method.equals("shenhe")){
String id=request.getParameter("id").trim();
String str=request.getParameter("str").trim();
int flag = tb.shenhe(id,str);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/kecheng/index.jsp").forward(request, response);
}
}
else if(method.equals("nohotkecheng")){
String id=request.getParameter("id").trim();
int flag = tb.nohotkecheng(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("admin/kecheng/hot.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("admin/kecheng/hot.jsp").forward(request, response);
}
}
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
4 在线课程分享网站效果演示
idea或eclipse开发,mysql数据库