• 大小: 12.64M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-26
  • 语言: 其他
  • 标签: 其他  

资源简介

SSM_users_dept.zip

资源截图

代码片段和文件信息

package com.xxc.controller;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONobject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xxc.pojo.Dept;
import com.xxc.pojo.Users;
import com.xxc.service.impl.UsersServiceImpl;
import com.xxc.serviceI.UsersServiceI;
import com.xxc.util.PageUtil;

@Controller
public class UsersAction{

@Autowired
private UsersServiceI usersService;

@RequestMapping(“/usersList.action“)
public String usersList(HttpServletRequest requestHttpServletResponse responseUsers users) throws UnsupportedEncodingException{
request.setCharacterEncoding(“UTF-8“);
response.setCharacterEncoding(“UTF-8“);

String currentPage = request.getParameter(“currentPage“);
int pageSize = 3;
int count = usersService.getCount();
PageUtil pageUtil = new PageUtil(currentPage pageSize count);
request.setAttribute(“pageUtil“ pageUtil);

users.setI((pageUtil.getCurrentPage()-1)*pageSize);
users.setJ(pageSize);
String name = users.getName();
if(name==null){
name=““;
}else {
name = new String(name.getBytes(“ISO-8859-1“)“UTF-8“);
}
users.setName(name);
List usersList = usersService.getUsersList(users);
List deptList = usersService.getDeptList();
request.setAttribute(“usersList“ usersList);
request.setAttribute(“deptList“ deptList);
return “list“;
}

@RequestMapping(“/addList.action“)
public String addList(HttpServletRequest requestHttpServletResponse responseUsers users) throws UnsupportedEncodingException{
request.setCharacterEncoding(“UTF-8“);
response.setCharacterEncoding(“UTF-8“);

usersService.addList(users);
String currentPage = request.getParameter(“currentPage“);
int pageSize = 3;
int count = usersService.getCount();
PageUtil pageUtil = new PageUtil(currentPage pageSize count);
request.setAttribute(“pageUtil“ pageUtil);

users.setI((pageUtil.getCurrentPage()-1)*pageSize);
users.setJ(pageSize);
users.setName(““);
List usersList = usersService.getUsersList(users);
List deptList = usersService.getDeptList();
request.setAttribute(“usersList“ usersList);
request.setAttribute(“deptList“ deptList);
return “list“;
}

@RequestMapping(“/toUpdate.action“)
public void toUpdate(HttpServletRequest requestHttpServletResponse response) throws IOException{
request.setCharacterEncoding(“UTF-8“);
response.setCharacterEncoding(“UTF-8“);

String id = request.getParameter(“id“);
Users users = usersService.getUsersById(Integer.parseInt(id));
JSONobject json = JSONobject.fromObje

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        4560  2016-12-14 16:08  project.sql
     目录           0  2016-12-09 16:01  SSM_users_dept\
     文件        3580  2016-12-09 16:01  SSM_users_dept\.classpath
     目录           0  2016-12-09 16:01  SSM_users_dept\.myeclipse\
     文件         316  2016-12-09 16:01  SSM_users_dept\.mymetadata
     文件        1287  2016-12-09 16:01  SSM_users_dept\.project
     目录           0  2016-12-09 16:01  SSM_users_dept\.settings\
     文件        1040  2016-12-09 16:01  SSM_users_dept\.settings\com.genuitec.eclipse.j2eedt.core.prefs
     文件          96  2016-12-09 16:01  SSM_users_dept\.settings\org.eclipse.core.resources.prefs
     文件         330  2016-12-09 16:01  SSM_users_dept\.settings\org.eclipse.jdt.core.prefs
     目录           0  2016-12-09 16:01  SSM_users_dept\config\
     文件        3086  2016-12-09 16:01  SSM_users_dept\config\beans.xml
     文件         124  2016-12-09 16:01  SSM_users_dept\config\jdbc.properties
     文件         663  2016-12-09 16:01  SSM_users_dept\config\log4j.properties
     文件         321  2016-12-09 16:01  SSM_users_dept\config\sqlMapConfig.xml
     目录           0  2016-12-09 16:01  SSM_users_dept\src\
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\controller\
     文件        4861  2016-12-09 16:01  SSM_users_dept\src\com\xxc\controller\UsersAction.java
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\dao\
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\daoI\
     文件         359  2016-12-09 16:01  SSM_users_dept\src\com\xxc\daoI\UsersDaoI.java
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\dao\impl\
     文件        1572  2016-12-09 16:01  SSM_users_dept\src\com\xxc\dao\impl\UsersDaoImpl.java
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\mapper\
     文件         834  2016-12-09 16:01  SSM_users_dept\src\com\xxc\mapper\DeptMapper.java
     文件        6070  2016-12-09 16:01  SSM_users_dept\src\com\xxc\mapper\DeptMapper.xml
     文件         891  2016-12-09 16:01  SSM_users_dept\src\com\xxc\mapper\UsersMapper.java
     文件        6808  2016-12-09 16:01  SSM_users_dept\src\com\xxc\mapper\UsersMapper.xml
     目录           0  2016-12-09 16:01  SSM_users_dept\src\com\xxc\pojo\
............此处省略97个文件信息

评论

共有 条评论