package com.xja.controller;
import com.github.pagehelper.PageInfo;
import com.xja.bean.Type;
import com.xja.service.impl.PeopleServiceImpl;
import com.xja.service.impl.TypeServiceImpl;
import com.xja.vo.SearchVo;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
@WebServlet( "/GetAll")
public class GetAll extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
String name = request.getParameter("name");
String sexDefault = null;
String sex = request.getParameter("sex");
if (sex!=null&& !sex.isEmpty()){
sexDefault = sex;
}
Integer typeIdDefault = null;
String typeId = request.getParameter("type");
if (typeId!=null&&!typeId.isEmpty()){
typeIdDefault = Integer.valueOf(typeId);
}
Integer pageNumDefault = 1;
Integer pageSize = 3;
String pageNum = request.getParameter("page");
if (pageNum!=null){
pageNumDefault = Integer.valueOf(pageNum);
}
SearchVo searchVo = new SearchVo(name,sexDefault,typeIdDefault);
PeopleServiceImpl peopleService = new PeopleServiceImpl();
PageInfo all = peopleService.getAllByCondition(pageNumDefault, pageSize, searchVo);
request.setAttribute("info",all);
TypeServiceImpl typeService = new TypeServiceImpl();
List<Type> all1 = typeService.getAll();
request.setAttribute("typeList",all1);
request.setAttribute("vo",searchVo);
request.getRequestDispatcher("/index.jsp").forward(request,response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
实现联系人前后端界面,实现分页查询
共76个文件
class:28个
xml:16个
java:14个
0 下载量 124 浏览量
2024-04-17
11:58:32
上传
评论
收藏 9.17MB ZIP 举报
温馨提示
实现联系人前后端界面,实现分页查询
资源推荐
资源详情
资源评论
收起资源包目录
0415contact.zip (76个子文件)
src
mybatis.xml 1KB
com
xja
mapper
PeopleMapper.xml 2KB
TypeMapper.xml 552B
TypeMapper.java 142B
PeopleMapper.java 266B
controller
Delete.java 840B
GetAllType.java 938B
GetAll.java 2KB
Add.java 1KB
service
PeopleService.java 342B
impl
TypeServiceImpl.java 791B
PeopleServiceImpl.java 2KB
TypeService.java 144B
test
util
SqlSessionUtil.java 2KB
vo
SearchVo.java 744B
bean
Type.java 579B
People.java 2KB
out
artifacts
0415contact_war_exploded
WEB-INF
classes
mybatis.xml 1KB
com
xja
mapper
PeopleMapper.xml 2KB
TypeMapper.xml 552B
PeopleMapper.class 358B
TypeMapper.class 216B
controller
GetAllType.class 2KB
GetAll.class 3KB
Delete.class 2KB
Add.class 2KB
service
PeopleService.class 330B
TypeService.class 219B
impl
PeopleServiceImpl.class 2KB
TypeServiceImpl.class 1KB
util
SqlSessionUtil.class 3KB
vo
SearchVo.class 1KB
bean
People.class 2KB
Type.class 934B
lib
mysql-connector-java-8.0.12.jar 1.93MB
jstl-1.2.jar 405KB
pagehelper-5.3.2.jar 117KB
mybatis-3.5.2.jar 1.62MB
jsqlparser-4.5.jar 879KB
web.xml 304B
index.jsp 4KB
js
jquery-3.5.1.min.js 87KB
add.jsp 1KB
production
0415contact
mybatis.xml 1KB
com
xja
mapper
PeopleMapper.xml 2KB
TypeMapper.xml 552B
PeopleMapper.class 358B
TypeMapper.class 216B
controller
GetAllType.class 2KB
GetAll.class 3KB
Delete.class 2KB
Add.class 2KB
service
PeopleService.class 330B
TypeService.class 219B
impl
PeopleServiceImpl.class 2KB
TypeServiceImpl.class 1KB
util
SqlSessionUtil.class 3KB
vo
SearchVo.class 1KB
bean
People.class 2KB
Type.class 934B
web
WEB-INF
lib
mysql-connector-java-8.0.12.jar 1.93MB
jstl-1.2.jar 405KB
pagehelper-5.3.2.jar 117KB
mybatis-3.5.2.jar 1.62MB
jsqlparser-4.5.jar 879KB
web.xml 304B
index.jsp 4KB
js
jquery-3.5.1.min.js 87KB
add.jsp 1KB
.idea
artifacts
0415contact_war_exploded.xml 519B
libraries
lib.xml 290B
workspace.xml 7KB
misc.xml 282B
modules.xml 269B
.gitignore 184B
0415contact.iml 1000B
共 76 条
- 1
资源评论
别挡
- 粉丝: 398
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功