基于Jsp+Servlet+MySQL简单的高校求职招聘系统

82 篇文章 16 订阅

首页

 

招聘信息

发布招聘

发布招聘

招聘信息

代码部分

代码部分

代码部分

代码部分

职位管理

技术描述

开发工具: Idea/Eclipse
数据库: mysql
Jar包仓库: Jar包
前段框架:jquery/Jsp
后端框架: Jsp/Servlet

资料说明

基于Jsp+Servlet+MySQL简单的高校求职招聘系统,分为普通用户和管理员,整体功能包含用户查询招聘信息,浏览招聘信息,发布招聘信息,管理员管理信息

package servlet;

import java.io.IOException;
import java.lang.reflect.Method;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Xiaoxi;
import dao.GuanliyuanDao;
import dao.XiaoxiDao;

/**
 * Servlet implementation class UserServlet
 */
@WebServlet("/guanliyuanServlet")
public class GuanliyuanServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public GuanliyuanServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("UTF-8");
		 response.setCharacterEncoding("GB2312");
		 String methodName = request.getParameter("method");
			
			try {
				Method method = getClass().getDeclaredMethod(methodName, HttpServletRequest.class, HttpServletResponse.class);
				method.setAccessible(true);
				method.invoke(this, request, response);
			} catch (Exception e) {
				e.printStackTrace();
				throw new RuntimeException(e);
			}
		}
	
	/*用户登录*/
	protected void login(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("GB2312"); 
        String zhanghao = request.getParameter("zhanghao");  
        String mima = request.getParameter("mima");
        GuanliyuanDao guanliyuanDao = new GuanliyuanDao();
        String psw =guanliyuanDao.getPassword(zhanghao);
        if(psw ==null){  
            request.getRequestDispatcher("/login.jsp").forward(request, response);  
        }  
        if(psw!=null&&!psw.equals(mima)){ 
            request.getRequestDispatcher("/login.jsp").forward(request, response);  
        }  
        if(psw.equals(mima)){  
            request.getRequestDispatcher("/admin.jsp").forward(request, response);  
            //response.setHeader("Refresh","1;url=welcome.jsp");  
        }
        
	}
	
	
	/*查找用户消息*/
	protected void finf_UserXiaoxi(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("GB2312"); 
        String id1 = request.getParameter("id");  
        int user_id = Integer.getInteger(id1);
        XiaoxiDao xiaoxiDao = new XiaoxiDao();
        Xiaoxi xiaoxi=xiaoxiDao.findByUser(user_id);
            request.setAttribute("xiaoxi", xiaoxi); 
            request.getRequestDispatcher("/edit-employee.jsp").forward(request, response);  
            //response.setHeader("Refresh","1;url=welcome.jsp");  
	}
	
	
	

}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

2016855150

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

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

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

打赏作者

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

抵扣说明:

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

余额充值