資源簡介
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?“l(fā)ist“;
}
@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?“l(fā)ist“;
}
@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\.myme
?????文件????????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.xm
?????文件?????????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.xm
?????目錄???????????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.xm
?????文件?????????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.xm
?????目錄???????????0??2016-12-09?16:01??SSM_users_dept\src\com\xxc\pojo\
............此處省略97個文件信息
評論
共有 條評論