基于java大学生招聘信息网站系统(java+jquery+html+mysql)

文章详细介绍了如何在Java中使用HttpServlet进行HTTP请求处理,包括登录验证、密码修改、文件上传功能,以及数据库设计和CRUD操作。同时提到了SpringBoot和SpringCloud实战以及面试题的整理,旨在帮助Java开发者提升技能和准备面试。
摘要由CSDN通过智能技术生成

public class MainCtrl extends HttpServlet {

public MainCtrl() {

super();

}

public void destroy() {

super.destroy(); // Just puts “destroy” string in log

// Put your code here

}

public void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

this.doPost(request, response);

}

public void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setContentType(“text/html”);

PrintWriter out = response.getWriter();

HttpSession session = request.getSession();

HashMap user = (HashMap)session.getAttribute(“admin”);

String ac = request.getParameter(“ac”);

if(ac==null)ac=“”;

CommDAO dao = new CommDAO();

String date = Info.getDateStr();

String today = date.substring(0,10);

String tomonth = date.substring(0,7);

if(ac.equals(“mlogin”))

{

String username = request.getParameter(“uname”);

String password = request.getParameter(“upass”);

List list = dao

.select(“select * from sysuser where uname='”

  • username + “'”);

if (list.size() == 1) {

HashMap map = list.get(0);

List ulist = dao

.select(“select * from sysuser where uname='”

  • username + “’ and upass='” + password

  • “'”);

if (ulist.size() == 1&& password.equals(map.get(“upass”).toString())) {

request.getSession().setAttribute(“admin”, map);

gor(“/jsp_qzzp_sys/index.jsp”, request, response);

} else {

request.setAttribute(“error”, “”);

go(“/index.jsp”, request, response);

}

} else {

request.setAttribute(“error”, “”);

go(“/index.jsp”, request, response);

}

}

//修改密码

if(ac.equals(“uppass”))

{

String olduserpass = request.getParameter(“olduserpass”);

String userpass = request.getParameter(“userpass”);

String copyuserpass = request.getParameter(“copyuserpass”);

user = dao.getmap(Info.getUser(request).get(“id”).toString(), “sysuser”);

if(!(((String)user.get(“upass”)).equals(olduserpass)))

{

request.setAttribute(“error”, “”);

go(“/admin/uppass.jsp”, request, response);

}else{

String id = (String)user.get(“id”);

String sql = “update sysuser set upass='”+userpass+“’ where id=”+id;

dao.commOper(sql);

request.setAttribute(“suc”, “”);

go(“/admin/uppass.jsp”, request, response);

}

}

if(ac.equals(“uploaddoc”))

{

try {

String filename=“”;

request.setCharacterEncoding(“utf-8”);

RequestContext requestContext = new ServletRequestContext(request);

if(FileUpload.isMultipartContent(requestContext)){

DiskFileItemFactory factory = new DiskFileItemFactory();

factory.setRepository(new File(request.getRealPath(“/upfile/”)+“/”));

ServletFileUpload upload = new ServletFileUpload(factory);

upload.setSizeMax(10010241024);

List items = new ArrayList();

items = upload.parseRequest(request);

FileItem fileItem = (FileItem) items.get(0);

if(fileItem.getName()!=null && fileItem.getSize()!=0)

{

if(fileItem.getName()!=null && fileItem.getSize()!=0){

File fullFile = new File(fileItem.getName());

filename = Info.generalFileName(fullFile.getName());

File newFile = new File(request.getRealPath(“/upfile/”)+“/” + filename);

try {

fileItem.write(newFile);

} catch (Exception e) {

e.printStackTrace();

}

}else{

}

}

}

go(“/js/uploaddoc.jsp?docname=”+filename, request, response);

} catch (Exception e1) {

e1.printStackTrace();

}

}

public void init() throws ServletException {

// Put your code here

}

public static void main(String[] args) {

System.out.println(new CommDAO().select(“select * from mixinfo”));

}

public void go(String url,HttpServletRequest request, HttpServletResponse response)

{

try {

request.getRequestDispatcher(url).forward(request, response);

} catch (ServletException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

}

public void gor(String url,HttpServletRequest request, HttpServletResponse response)

{

try {

response.sendRedirect(url);

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

主要数据库设计:


CREATE TABLE IF NOT EXISTS fav (

id int(11) NOT NULL AUTO_INCREMENT,

qzzuname varchar(255) DEFAULT NULL,

zpinfoid varchar(255) DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS area (

id int(11) NOT NULL AUTO_INCREMENT,

addr varchar(255) DEFAULT NULL,

delstatus varchar(255) DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS emp (

id int(11) NOT NULL AUTO_INCREMENT,

uname varchar(255) DEFAULT NULL,

tname varchar(255) DEFAULT NULL,

title varchar(255) DEFAULT NULL,

savetime varchar(255) DEFAULT NULL,

status varchar(255) DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS yqlj (

id int(11) NOT NULL AUTO_INCREMENT,

ljname varchar(255) DEFAULT NULL,

ljurl varchar(255) DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS zdatadic (

id int(11) NOT NULL AUTO_INCREMENT,

datatype varchar(255) DEFAULT NULL,

ptitle varchar(255) DEFAULT NULL,

content text DEFAULT NULL,

savetime varchar(255) DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS zpinfo (

id int(11) NOT NULL AUTO_INCREMENT,

title varchar(255) DEFAULT NULL,

zprs varchar(255) DEFAULT NULL,

gzdd varchar(255) DEFAULT NULL,

xl varchar(255) DEFAULT NULL,

jl varchar(255) DEFAULT NULL,

infotype varchar(255) DEFAULT NULL,

bei varchar(255) DEFAULT NULL,

dy varchar(255) DEFAULT NULL,

savetime varchar(255) DEFAULT NULL,

qyuname varchar(255) DEFAULT NULL,

qytname varchar(255) DEFAULT NULL,

gznr text DEFAULT NULL,

fl text DEFAULT NULL,

PRIMARY KEY (id)

) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS hbnews (

id int(11) NOT NULL AUTO_INCREMENT,

title varchar(255) DEFAULT NULL,

author varchar(255) DEFAULT NULL,

filename varchar(255) DEFAULT NULL,

content text DEFAULT NULL,

savetime varchar(255) DEFAULT NULL,

infotype varchar(255) DEFAULT NULL,

PRIMARY KEY (id)
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)

img

分享

这次面试我也做了一些总结,确实还有很多要学的东西。相关面试题也做了整理,可以分享给大家,了解一下面试真题,想进大厂的或者想跳槽的小伙伴不妨好好利用时间来学习。学习的脚步一定不能停止!

薪酬缩水,“裸辞”奋战25天三面美团,交叉面却被吊打,我太难了

Spring Cloud实战

薪酬缩水,“裸辞”奋战25天三面美团,交叉面却被吊打,我太难了

Spring Boot实战

薪酬缩水,“裸辞”奋战25天三面美团,交叉面却被吊打,我太难了

面试题整理(性能优化+微服务+并发编程+开源框架+分布式)
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
s/e5c14a7895254671a72faed303032d36.jpg" alt=“img” style=“zoom: 33%;” />

分享

这次面试我也做了一些总结,确实还有很多要学的东西。相关面试题也做了整理,可以分享给大家,了解一下面试真题,想进大厂的或者想跳槽的小伙伴不妨好好利用时间来学习。学习的脚步一定不能停止!

[外链图片转存中…(img-6xt8creX-1713608085598)]

Spring Cloud实战

[外链图片转存中…(img-fxO0zSbq-1713608085599)]

Spring Boot实战

[外链图片转存中…(img-bIgxKRhr-1713608085600)]

面试题整理(性能优化+微服务+并发编程+开源框架+分布式)
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值