本文讲述了一个大学生就业服务网站的开发过程
基本信息管理:企业注册登陆后,即可以对自己的注册信息进行修改。
招聘信息管理:企业登陆以后,即可发布、修改、删除自己的招聘信息。
以上所有功能都是对会员企业即已注册的会员而言,对于还没有注册的企业,他们就不能享有这些权限,他们只能查看基本的学生求职信息和网站中公布的消息。
对于学生用户而言,用户注册后可进入会员中心,填写、修改基本信息,个人用户可查看招聘单位的详细信息。
对于管理员而言,有操作所有功能模块的权限,可以对所有用户的基本信息录入、修改、查询、删除以及查看、修改和删除发布的各种信息,并可以修改自己的用户名和密码。
它的部分数据库表摘录如下
简历表
字段名称 |
自动增长 |
字段类型 |
说明 |
id |
- |
int |
编号 |
member |
- |
varchar |
会员 |
picurl |
- |
varchar |
图片 |
mname |
- |
varchar |
名称 |
sex |
- |
varchar |
性别 |
age |
- |
varchar |
年龄 |
school |
- |
varchar |
学校 |
bir |
- |
varchar |
生日 |
address |
- |
varchar |
地址 |
linkman |
- |
varchar |
联系人 |
tel |
- |
varchar |
电话 |
|
- |
varchar |
邮件 |
intro |
- |
varchar |
说明 |
addtime |
- |
date |
日期 |
其中部分关键的代码摘录如下
package com.action;
/**
* 会员中心求职招聘信息发布 修改 删除
*/
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.JobBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.Filter;
public class JobServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public JobServlet() {
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 {
response.setContentType(Constant.CONTENTTYPE);
request.setCharacterEncoding(Constant.CHARACTERENCODING);
HttpSession session = request.getSession();
try{
String member = (String)session.getAttribute("member");
String type = (String)session.getAttribute("type");
if(member == null||type == null){
request.getRequestDispatcher("error.jsp").forward(request, response);
}
else{
SystemBean systemBean = new SystemBean();
JobBean jobBean = new JobBean();
String method = Filter.escapeHTMLTags(request.getParameter("action").trim());
/**********************************************************
* 会员中心 招聘信息增 删 改
**********************************************************/
if(method.equals("add")){//发布招聘信息
String need = Filter.escapeHTMLTags(request.getParameter("need").trim());
String num = Filter.escapeHTMLTags(request.getParameter("num").trim());
String danwei = Filter.escapeHTMLTags(request.getParameter("danwei").trim());
String linkman = Filter.escapeHTMLTags(request.getParameter("linkman").trim());
String tel = Filter.escapeHTMLTags(request.getParameter("tel").trim());
String place = Filter.escapeHTMLTags(request.getParameter("place").trim());
String pay = Filter.escapeHTMLTags(request.getParameter("pay").trim());
String yxq = Filter.escapeHTMLTags(request.getParameter("yxq").trim());
String otherneed = Filter.escapeHTMLTags(request.getParameter("otherneed").trim());
if(otherneed.equals("")){
otherneed="无";
}
int flag = jobBean.addJOB1(need, num, danwei, linkman, tel, place, pay, yxq, otherneed, member, type, 1);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "发布信息成功!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
}
else if(method.equals("editadd")){//修改招聘信息
String id = Filter.escapeHTMLTags(request.getParameter("id").trim());
String need = Filter.escapeHTMLTags(request.getParameter("need").trim());
String num = Filter.escapeHTMLTags(request.getParameter("num").trim());
String danwei = Filter.escapeHTMLTags(request.getParameter("danwei").trim());
String linkman = Filter.escapeHTMLTags(request.getParameter("linkman").trim());
String tel = Filter.escapeHTMLTags(request.getParameter("tel").trim());
String place = Filter.escapeHTMLTags(request.getParameter("place").trim());
String pay = Filter.escapeHTMLTags(request.getParameter("pay").trim());
String yxq = Filter.escapeHTMLTags(request.getParameter("yxq").trim());
String otherneed = Filter.escapeHTMLTags(request.getParameter("otherneed").trim());
if(otherneed.equals("")){
otherneed="无";
}
int flag = jobBean.upJOB1(Integer.parseInt(id), need, num, danwei, linkman, tel, place, pay, yxq, otherneed, 1);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "修改信息成功!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
}
else if(method.equals("mdeljob")){//会员中心删除招聘信息
int id=Integer.parseInt(request.getParameter("id").trim());
int flag = jobBean.delAdd1(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "删除记录成功!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/index.jsp").forward(request, response);
}
}
/*****************************************************
* 求职信息
***************************************************/
else if(method.equals("add2")){//发布求职
String job = Filter.escapeHTMLTags(request.getParameter("job2").trim());
String pay = Filter.escapeHTMLTags(request.getParameter("pay").trim());
String school = Filter.escapeHTMLTags(request.getParameter("school").trim());
String sex = Filter.escapeHTMLTags(request.getParameter("sex").trim());
String age = Filter.escapeHTMLTags(request.getParameter("age").trim());
String sheng = Filter.escapeHTMLTags(request.getParameter("sheng").trim());
String city = Filter.escapeHTMLTags(request.getParameter("city").trim());
String linkman = Filter.escapeHTMLTags(request.getParameter("linkman").trim());
String tel = Filter.escapeHTMLTags(request.getParameter("tel").trim());
String yxq = Filter.escapeHTMLTags(request.getParameter("yxq").trim());
String intro = Filter.escapeHTMLTags(request.getParameter("intro").trim());
String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
if(intro.equals("")){
intro="无";
}
int flag = jobBean.addJOB2(job, pay, school, sex, age, sheng, city, linkman, tel, yxq, intro, member, type, 1,email);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "发布信息成功!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
}
else if(method.equals("editadd2")){//修改求职
String id = Filter.escapeHTMLTags(request.getParameter("id").trim());
String job = Filter.escapeHTMLTags(request.getParameter("job2").trim());
String pay = Filter.escapeHTMLTags(request.getParameter("pay").trim());
String school = Filter.escapeHTMLTags(request.getParameter("school").trim());
String sex = Filter.escapeHTMLTags(request.getParameter("sex").trim());
String age = Filter.escapeHTMLTags(request.getParameter("age").trim());
String sheng = Filter.escapeHTMLTags(request.getParameter("sheng").trim());
String city = Filter.escapeHTMLTags(request.getParameter("city").trim());
String linkman = Filter.escapeHTMLTags(request.getParameter("linkman").trim());
String tel = Filter.escapeHTMLTags(request.getParameter("tel").trim());
String yxq = Filter.escapeHTMLTags(request.getParameter("yxq").trim());
String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
String intro = Filter.escapeHTMLTags(request.getParameter("intro").trim());
if(intro.equals("")){
intro="无";
}
int flag = jobBean.upJOB2(Integer.parseInt(id), job, pay, school, sex, age, sheng, city, linkman, tel, yxq, intro, 1,email);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "修改信息成功!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
}
else if(method.equals("mdeljob2")){//会员中心删除求职信息
int id=Integer.parseInt(request.getParameter("id").trim());
int flag = jobBean.delAdd2(id);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "删除记录成功!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/default.jsp").forward(request, response);
}
}
else if(method.equals("sendresume")){//递交求职申请和简历
String id=request.getParameter("id").trim();
int flag = jobBean.sendResume(Integer.parseInt(id), member);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "发送求职申请并递交简历成功!");
request.getRequestDispatcher("index.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("index.jsp").forward(request, response);
}
}
else if(method.equals("delsendresume")){//删除已递交求职申请和简历
String id=request.getParameter("id").trim();
int flag = jobBean.delsendResume(Integer.parseInt(id));
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/default2.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/default2.jsp").forward(request, response);
}
}
else if(method.equals("delgetInterView")){//删除接收到的面试通知
String id=request.getParameter("id").trim();
int flag = jobBean.delgetInterView(Integer.parseInt(id));
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/interview.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/interview.jsp").forward(request, response);
}
}
else if(method.equals("delshenqing")){//企业会员删除接收到的求职申请
String id=request.getParameter("id").trim();
int flag = jobBean.codelsendResume(Integer.parseInt(id));
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
}
else if(method.equals("delmstz")){//企业会员删除面试通知
String id=request.getParameter("id").trim();
int flag = jobBean.codelgetInterView(Integer.parseInt(id));
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/view.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/view.jsp").forward(request, response);
}
}
else if(method.equals("sendView")){//企业会员发送面试通知
String id=request.getParameter("id").trim();
String member2=request.getParameter("member2").trim();
String viewtime=request.getParameter("viewtime").trim();
String didian=request.getParameter("didian").trim();
String linkman=request.getParameter("linkman").trim();
String tel=request.getParameter("tel").trim();
int flag = jobBean.addInterView(id, member2, viewtime, didian, linkman, tel);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
}
else if(method.equals("addstore")){//加入人才库
String member2=request.getParameter("member2").trim();
int flag = jobBean.addStore(member2, member);
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/sendmanage.jsp").forward(request, response);
}
}
else if(method.equals("delstore")){//删除人才库
String id=request.getParameter("id").trim();
int flag = jobBean.delStore(Integer.parseInt(id));
if(flag == Constant.SUCCESS){
request.setAttribute("message", "操作成功!");
request.getRequestDispatcher("member/job/store.jsp").forward(request, response);
}
else{
request.setAttribute("message", "系统维护中,请稍后再试!");
request.getRequestDispatcher("member/job/store.jsp").forward(request, response);
}
}
else{
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
}catch(Exception e){
e.printStackTrace();
request.getRequestDispatcher("error.jsp").forward(request, response);
}
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
最终的界面演示截图