
基于javaweb+jsp的新生报道管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Layui Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Layui Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
layer.msg(data.noticeName + ' 删除成功!');
// });
} else if (layEvent === 'edit') { //编辑
layer.open({
type: 2,
area: ['800px', '550px'],
fixed: false, //不固定
maxmin: true,
content: 'noticeEditPre?id=' + data.id
});
obj.update({});//同步更新缓存对应的值
} else if (layEvent === 'info') { //详情
layer.open({
vo.setUserText(Util.decode(request, "userText"));
vo.setUserType(Util.decode(request, "userType"));
userService.update(vo);
this.redirectList(request, response);
}
@RequestMapping({"userGet", "userEditPre"})
public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");//取出主键id
User vo = userService.get(id);
request.getSession().setAttribute("vo", vo);
public Baodao get(Serializable id) {
return this.baodaoMapper.findById(id);
}
//@Override
public Map list(Map params) {
Map resultMap = new HashMap();
resultMap.put("totalCount", this.baodaoMapper.getAllCount(params));
resultMap.put("list", this.baodaoMapper.findAllSplit(params));
return resultMap;
}
}
package com.demo.service.impl;
import com.demo.dao.NoticeMapper;
import com.demo.service.NoticeService;
import com.demo.vo.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
line-height: 120px;
}
.login-wrapper .form-wrapper .input-item {
display: block;
width: 100%;
margin-bottom: 20px;
border: 0;
padding: 10px;
border-bottom: 1px solid rgb(128, 125, 125);
font-size: 15px;
outline: none;
}
.login-wrapper .form-wrapper .input-item ::placeholder {
text-transform: uppercase;
}
.login-wrapper .form-wrapper .btn {
text-align: center;
padding: 10px;
margin-top: 40px;
width: 100%;
background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("noticeEdit")
public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
Notice vo = new Notice();
vo.setId(Long.valueOf(Util.decode(request, "id")));
vo.setNoticeName(Util.decode(request, "noticeName"));
vo.setNoticeText(Util.decode(request, "noticeText"));
vo.setNoticeType(Util.decode(request, "noticeType"));
vo.setCreateDate(Util.decode(request, "createDate"));
noticeService.update(vo);
this.redirectList(request, response);
}
String searchColumn = Util.decode(request, "searchColumn");
String keyword = Util.decode(request, "keyword");
Map params = new HashMap();//用来保存控制层传进来的参数(查询条件)
params.put("searchColumn", searchColumn);//要查询的列
params.put("keyword", keyword);//查询的关键字
response.getWriter().println(com.alibaba.fastjson.JSONObject.toJSONString(baodaoService.list(params).get("list")));
}
}
package com.demo.controller;
import com.demo.util.Util;
import com.demo.service.UserService;
import com.demo.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
response.sendRedirect("baodao_" + to + ".jsp");
}
@RequestMapping("baodaoList")
public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
this.redirectList(request, response);
}
type: 2,
area: ['800px', '550px'],
fixed: false, //不固定
maxmin: true,
content: 'user_add.jsp'
});
} else {
//layer.alert('这是工具栏右侧自定义的一个图标按钮');
}
});
//搜索
let $ = layui.$, active = {
reload: function () {
let url = 'userList?keyword=' + $('#search_keyword').val() + '&searchColumn=' + $('#searchColumn').val();
//执行重载