Java Jsp+Servlet+mysql实现的在线招聘系统(系统管理员/企业用户/学生 功能:招聘信息、投递简历、筛选简历、面试资料下载、就业信息、就业新闻、留言板等)

JSP在线招聘系统

本系统是一套用户学生和企业投递简历以及筛选人才的网站,包含常用的招聘网站功能,美观实用。

实现功能截图

用户未登录系统首页:
在这里插入图片描述
用户登录成功提示:
在这里插入图片描述
用户登录成功:
在这里插入图片描述
留言板:
在这里插入图片描述
个人管理中心:
在这里插入图片描述
资料下载:
在这里插入图片描述
就业信息:
在这里插入图片描述

技术点总结:

jsp、Servlet
jdk版本:1.7
tomcat: 7.0
数据库:mysql
开发工具:eclipse

项目包结构分类清晰:
在这里插入图片描述

代码

model类:
TAdmin.java:

package com.model;

/**
 * TAdmin generated by MyEclipse Persistence Tools
 */

public class TAdmin implements java.io.Serializable {

	// Fields

	private Integer userId;

	private String userName;

	private String userPw;

	// Constructors

	/** default constructor */
	public TAdmin() {
	}

	/** full constructor */
	public TAdmin(String userName, String userPw) {
		this.userName = userName;
		this.userPw = userPw;
	}

	// Property accessors


	public String getUserName() {
		return this.userName;
	}

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

	public String getUserPw() {
		return this.userPw;
	}

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

	public Integer getUserId()
	{
		return userId;
	}

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

}

TStu.java:

package com.model;

/**
 * TStu generated by MyEclipse Persistence Tools
 */

public class TStu implements java.io.Serializable
{

	private Integer stuId;
	
	private String stuXuehao;
	private String stuRealname;
	private String stuSex;
	private String stuAge;


	private String loginName;
	private String loginPw;
	private String del;
	
	
	public String getDel()
	{
		return del;
	}
	public void setDel(String del)
	{
		this.del = del;
	}
	public String getLoginName()
	{
		return loginName;
	}
	public void setLoginName(String loginName)
	{
		this.loginName = loginName;
	}
	public String getLoginPw()
	{
		return loginPw;
	}
	public void setLoginPw(String loginPw)
	{
		this.loginPw = loginPw;
	}
	public String getStuAge()
	{
		return stuAge;
	}
	public void setStuAge(String stuAge)
	{
		this.stuAge = stuAge;
	}
	public Integer getStuId()
	{
		return stuId;
	}
	public void setStuId(Integer stuId)
	{
		this.stuId = stuId;
	}
	public String getStuRealname()
	{
		return stuRealname;
	}
	public void setStuRealname(String stuRealname)
	{
		this.stuRealname = stuRealname;
	}
	public String getStuSex()
	{
		return stuSex;
	}
	public void setStuSex(String stuSex)
	{
		this.stuSex = stuSex;
	}
	public String getStuXuehao()
	{
		return stuXuehao;
	}
	public void setStuXuehao(String stuXuehao)
	{
		this.stuXuehao = stuXuehao;
	}

}

dao层:
TAdminDAO.java:

package com.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.model.TAdmin;

/**
 * Data access object (DAO) for domain model class TAdmin.
 * 
 * @see com.model.TAdmin
 * @author MyEclipse Persistence Tools
 */

public class TAdminDAO extends HibernateDaoSupport {
	private static final Log log = LogFactory.getLog(TAdminDAO.class);

	// property constants
	public static final String USER_NAME = "userName";

	public static final String USER_PW = "userPw";

	protected void initDao() {
		// do nothing
	}

	public void save(TAdmin transientInstance) {
		log.debug("saving TAdmin instance");
		try {
			getHibernateTemplate().save(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}

	public void delete(TAdmin persistentInstance) {
		log.debug("deleting TAdmin instance");
		try {
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
		} catch (RuntimeException re) {
			log.error("delete failed", re);
			throw re;
		}
	}

	public TAdmin findById(java.lang.Integer id) {
		log.debug("getting TAdmin instance with id: " + id);
		try {
			TAdmin instance = (TAdmin) getHibernateTemplate().get(
					"com.model.TAdmin", id);
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(TAdmin instance) {
		log.debug("finding TAdmin instance by example");
		try {
			List results = getHibernateTemplate().findByExample(instance);
			log.debug("find by example successful, result size: "
					+ results.size());
			return results;
		} catch (RuntimeException re) {
			log.error("find by example failed", re);
			throw re;
		}
	}

	public List findByProperty(String propertyName, Object value) {
		log.debug("finding TAdmin instance with property: " + propertyName
				+ ", value: " + value);
		try {
			String queryString = "from TAdmin as model where model."
					+ propertyName + "= ?";
			return getHibernateTemplate().find(queryString, value);
		} catch (RuntimeException re) {
			log.error("find by property name failed", re);
			throw re;
		}
	}

	public List findByUserName(Object userName) {
		return findByProperty(USER_NAME, userName);
	}

	public List findByUserPw(Object userPw) {
		return findByProperty(USER_PW, userPw);
	}

	public List findAll() {
		log.debug("finding all TAdmin instances");
		try {
			String queryString = "from TAdmin";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

	public TAdmin merge(TAdmin detachedInstance) {
		log.debug("merging TAdmin instance");
		try {
			TAdmin result = (TAdmin) getHibernateTemplate().merge(
					detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public void attachDirty(TAdmin instance) {
		log.debug("attaching dirty TAdmin instance");
		try {
			getHibernateTemplate().saveOrUpdate(instance);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public void attachClean(TAdmin instance) {
		log.debug("attaching clean TAdmin instance");
		try {
			getHibernateTemplate().lock(instance, LockMode.NONE);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public static TAdminDAO getFromApplicationContext(ApplicationContext ctx) {
		return (TAdminDAO) ctx.getBean("TAdminDAO");
	}
}

TStuDAO.java:

package com.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.model.TStu;

/**
 * Data access object (DAO) for domain model class TStu.
 * 
 * @see com.model.TStu
 * @author MyEclipse Persistence Tools
 */

public class TStuDAO extends HibernateDaoSupport
{
	private static final Log log = LogFactory.getLog(TStuDAO.class);

	// property constants
	public static final String STU_XUEHAO = "stuXuehao";

	public static final String STU_REALNAME = "stuRealname";

	public static final String STU_SEX = "stuSex";

	public static final String STU_AGE = "stuAge";

	public static final String STU_CARD = "stuCard";

	public static final String STU_ZHENGZHIMIANMAO = "stuZhengzhimianmao";

	public static final String LOGIN_NAME = "loginName";

	public static final String LOGIN_PW = "loginPw";

	public static final String DEL = "del";

	protected void initDao()
	{
		// do nothing
	}

	public void save(TStu transientInstance)
	{
		log.debug("saving TStu instance");
		try
		{
			getHibernateTemplate().save(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re)
		{
			log.error("save failed", re);
			throw re;
		}
	}

	public void delete(TStu persistentInstance)
	{
		log.debug("deleting TStu instance");
		try
		{
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
		} catch (RuntimeException re)
		{
			log.error("delete failed", re);
			throw re;
		}
	}

	public TStu findById(java.lang.Integer id)
	{
		log.debug("getting TStu instance with id: " + id);
		try
		{
			TStu instance = (TStu) getHibernateTemplate().get("com.model.TStu",
					id);
			return instance;
		} catch (RuntimeException re)
		{
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(TStu instance)
	{
		log.debug("finding TStu instance by example");
		try
		{
			List results = getHibernateTemplate().findByExample(instance);
			log.debug("find by example successful, result size: "
					+ results.size());
			return results;
		} catch (RuntimeException re)
		{
			log.error("find by example failed", re);
			throw re;
		}
	}

	public List findByProperty(String propertyName, Object value)
	{
		log.debug("finding TStu instance with property: " + propertyName
				+ ", value: " + value);
		try
		{
			String queryString = "from TStu as model where model."
					+ propertyName + "= ?";
			return getHibernateTemplate().find(queryString, value);
		} catch (RuntimeException re)
		{
			log.error("find by property name failed", re);
			throw re;
		}
	}

	public List findByStuXuehao(Object stuXuehao)
	{
		return findByProperty(STU_XUEHAO, stuXuehao);
	}

	public List findByStuRealname(Object stuRealname)
	{
		return findByProperty(STU_REALNAME, stuRealname);
	}

	public List findByStuSex(Object stuSex)
	{
		return findByProperty(STU_SEX, stuSex);
	}

	public List findByStuAge(Object stuAge)
	{
		return findByProperty(STU_AGE, stuAge);
	}

	public List findByStuCard(Object stuCard)
	{
		return findByProperty(STU_CARD, stuCard);
	}

	public List findByStuZhengzhimianmao(Object stuZhengzhimianmao)
	{
		return findByProperty(STU_ZHENGZHIMIANMAO, stuZhengzhimianmao);
	}

	public List findByLoginName(Object loginName)
	{
		return findByProperty(LOGIN_NAME, loginName);
	}

	public List findByLoginPw(Object loginPw)
	{
		return findByProperty(LOGIN_PW, loginPw);
	}

	public List findByDel(Object del)
	{
		return findByProperty(DEL, del);
	}

	public List findAll()
	{
		log.debug("finding all TStu instances");
		try
		{
			String queryString = "from TStu";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re)
		{
			log.error("find all failed", re);
			throw re;
		}
	}

	public TStu merge(TStu detachedInstance)
	{
		log.debug("merging TStu instance");
		try
		{
			TStu result = (TStu) getHibernateTemplate().merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re)
		{
			log.error("merge failed", re);
			throw re;
		}
	}

	public void attachDirty(TStu instance)
	{
		log.debug("attaching dirty TStu instance");
		try
		{
			getHibernateTemplate().saveOrUpdate(instance);
			log.debug("attach successful");
		} catch (RuntimeException re)
		{
			log.error("attach failed", re);
			throw re;
		}
	}

	public void attachClean(TStu instance)
	{
		log.debug("attaching clean TStu instance");
		try
		{
			getHibernateTemplate().lock(instance, LockMode.NONE);
			log.debug("attach successful");
		} catch (RuntimeException re)
		{
			log.error("attach failed", re);
			throw re;
		}
	}

	public static TStuDAO getFromApplicationContext(ApplicationContext ctx)
	{
		return (TStuDAO) ctx.getBean("TStuDAO");
	}
}

action层:
adminAction.java:

package com.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.dao.TAdminDAO;
import com.model.TAdmin;
import com.opensymphony.xwork2.ActionSupport;

public class adminAction extends ActionSupport
{
	private int userId;
	private String userName;
	private String userPw;
	 
	private String message;
	private String path;
	
	private int index=1;

	private TAdminDAO adminDAO;
	
	
	public String adminAdd()
	{
		TAdmin admin=new TAdmin();
		admin.setUserName(userName);
		admin.setUserPw(userPw);
		adminDAO.save(admin);
		this.setMessage("操作成功");
		this.setPath("adminManage.action");
		return "succeed";
	}
	
	
	
	public String adminManage()
	{
		List adminList=adminDAO.findAll();
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("adminList", adminList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String adminDel()
	{
		adminDAO.delete(adminDAO.findById(userId));
		this.setMessage("删除成功");
		this.setPath("adminManage.action");
		return "succeed";
	}
	
	

	public TAdminDAO getAdminDAO()
	{
		return adminDAO;
	}

	public void setAdminDAO(TAdminDAO adminDAO)
	{
		this.adminDAO = adminDAO;
	}

	public String getMessage()
	{
		return message;
	}

	public int getIndex()
	{
		return index;
	}



	public void setIndex(int index)
	{
		this.index = index;
	}



	public void setMessage(String message)
	{
		this.message = message;
	}

	public String getPath()
	{
		return path;
	}

	public void setPath(String path)
	{
		this.path = path;
	}

	public int getUserId()
	{
		return userId;
	}

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

	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;
	}
	 
}

stuAction.java:

package com.action;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.dao.TStuDAO;
import com.model.TStu;
import com.opensymphony.xwork2.ActionSupport;

public class stuAction extends ActionSupport
{
private Integer stuId;
	
	private String stuXuehao;
	private String stuRealname;
	private String stuSex;
	private String stuAge;


	private String loginName;
	private String loginPw;
	private String del;
	 
	private String message;
	private String path;
	private TStuDAO stuDAO;
	
	
	
	public String stuAdd()
	{
		TStu stu=new TStu();
		stu.setStuXuehao(stuXuehao);
		stu.setStuRealname(stuRealname);
		stu.setStuSex(stuSex);
		stu.setStuAge(stuAge);
		stu.setLoginName(loginName);
		stu.setLoginPw(loginPw);
		stu.setDel("no");
		stuDAO.save(stu);
		
		HttpServletRequest request=ServletActionContext.getRequest();
		request.setAttribute("msg", "注册成功,请登录");
		return "msg";
	}
	

	public String stuDel()
	{
		TStu stu=stuDAO.findById(stuId);
		stu.setDel("yes");
		stuDAO.attachDirty(stu);
		this.setMessage("删除成功");
		this.setPath("stuMana.action");
		return "succeed";
	}
	
	
	public String stuMana()
	{
		List stuList=stuDAO.getHibernateTemplate().find("from TStu where del='no'");
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("stuList", stuList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String stuEditByMe()
	{
		Map session= ServletActionContext.getContext().getSession();
		TStu stu=(TStu)session.get("stu");
		
		stu.setStuXuehao(stuXuehao);
		stu.setStuRealname(stuRealname);
		stu.setStuSex(stuSex);
		stu.setStuAge(stuAge);
		
		stu.setLoginName(loginName);
		stu.setLoginPw(loginPw);
		stu.setDel("no");
		
		stuDAO.attachDirty(stu);
		session.put("stu", stu);
		this.setMessage("操作成功");
		this.setPath("astu/userinfo/stuinfo.jsp");
		return "succeed";
	}


	public String getDel()
	{
		return del;
	}


	public void setDel(String del)
	{
		this.del = del;
	}


	public String getLoginName()
	{
		return loginName;
	}


	public void setLoginName(String loginName)
	{
		this.loginName = loginName;
	}


	public String getLoginPw()
	{
		return loginPw;
	}


	public void setLoginPw(String loginPw)
	{
		this.loginPw = loginPw;
	}


	public String getMessage()
	{
		return message;
	}


	public void setMessage(String message)
	{
		this.message = message;
	}


	public String getPath()
	{
		return path;
	}


	public void setPath(String path)
	{
		this.path = path;
	}


	public String getStuAge()
	{
		return stuAge;
	}


	public void setStuAge(String stuAge)
	{
		this.stuAge = stuAge;
	}


	public TStuDAO getStuDAO()
	{
		return stuDAO;
	}


	public void setStuDAO(TStuDAO stuDAO)
	{
		this.stuDAO = stuDAO;
	}


	public Integer getStuId()
	{
		return stuId;
	}


	public void setStuId(Integer stuId)
	{
		this.stuId = stuId;
	}


	public String getStuRealname()
	{
		return stuRealname;
	}


	public void setStuRealname(String stuRealname)
	{
		this.stuRealname = stuRealname;
	}


	public String getStuSex()
	{
		return stuSex;
	}


	public void setStuSex(String stuSex)
	{
		this.stuSex = stuSex;
	}


	public String getStuXuehao()
	{
		return stuXuehao;
	}


	public void setStuXuehao(String stuXuehao)
	{
		this.stuXuehao = stuXuehao;
	}
	
}

写在最后

码代码不容易,需要的同学可以参考学习,全部代码不能都贴出,如果需要可以+博主V交流获取(Code2Life2)
最后,别忘了一键三连哦

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

anmu4200

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

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

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

打赏作者

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

抵扣说明:

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

余额充值