资源简介
MyEclipse10+SSH框架+Oracle11g,最新完美版,做好了所有验证,直接可运行交工,作者7天独立作品,不足之处请多包涵。(ZeusSir出品,必属精品.)
代码片段和文件信息
package com.crm.auth.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;
import com.crm.auth.entity.Role;
import com.crm.auth.entity.Role_Right;
import com.crm.auth.service.RoleRightService;
import com.crm.auth.service.RoleService;
import com.crm.common.entity.PageBean;
import com.opensymphony.xwork2.ActionSupport;
public class RoleAction extends ActionSupport implements RequestAwareSessionAwareApplicationAware {
Mapject> Session;
Mapject> Request;
Mapject> Application;
private String[] rightCode = null; //用于获取页面权限信息
private PageBean pager; //用于获取分页查询显示
private Role r;
private RoleService roleService;
private RoleRightService rrService;
public Mapject> getSession() {
return Session;
}
public void setSession(Mapject> session) {
Session = session;
}
public Mapject> getRequest() {
return Request;
}
public void setRequest(Mapject> request) {
Request = request;
}
public Mapject> getApplication() {
return Application;
}
public void setApplication(Mapject> application) {
Application = application;
}
public String[] getRightCode() {
return rightCode;
}
public void setRightCode(String[] rightCode) {
this.rightCode = rightCode;
}
public PageBean getPager() {
return pager;
}
public void setPager(PageBean pager) {
this.pager = pager;
}
public Role getR() {
return r;
}
public void setR(Role r) {
this.r = r;
}
public RoleService getRoleService() {
return roleService;
}
public void setRoleService(RoleService roleService) {
this.roleService = roleService;
}
public RoleRightService getRrService() {
return rrService;
}
public void setRrService(RoleRightService rrService) {
this.rrService = rrService;
}
//--------方法开始-------------------------
//查询全部
public String find(){
pager = roleService.splitPage(pager.getPageIndex() pager.getPageSize());
List list = pager.getList();
Session.put(“rolelist“list);
return “success“;
}
//条件查询
public String findHQL(){
List list = roleService.find(r);
Session.put(“rolelist“list);
return “success“;
}
public String add(){
boolean flag = roleService.add(r);
if(flag){
Role_Right rr = new Role_Right();
rr.setRoleId(r.getRoleId());
if(rightCode != null){
for (int i = 0; i < rightCode.length; i++) {
int rid = Integer.parseInt(rightCode[i]); //转int
rr.setRightId(rid);
boolean flag1 = rrService.add(rr);
if(flag1 == false){
Request.put(“error_message“ “新增角色成功,部分授权未成功,请返回角色列表重新编辑权限!“);
return “error“;
}
}
rightCode = null; //权限数组清空
}
return this.find();
}
Request.put(“error
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 529 2015-04-06 13:47 CRM\.classpath
目录 0 2015-04-06 13:47 CRM\.myeclipse\
文件 282 2015-04-15 02:36 CRM\.myme
文件 1746 2015-04-15 02:36 CRM\.project
目录 0 2015-04-15 14:04 CRM\src\
文件 12904 2015-04-15 14:03 CRM\src\applicationContext.xm
目录 0 2015-04-15 14:04 CRM\src\com\
目录 0 2015-04-15 14:04 CRM\src\com\crm\
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\action\
文件 4546 2015-04-15 01:55 CRM\src\com\crm\auth\action\RoleAction.java
文件 4202 2015-04-15 14:03 CRM\src\com\crm\auth\action\UserAction.java
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\dao\
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\dao\impl\
文件 1911 2015-04-13 15:44 CRM\src\com\crm\auth\dao\impl\RoleDaoImpl.java
文件 1768 2015-04-14 20:06 CRM\src\com\crm\auth\dao\impl\RoleRightDaoImpl.java
文件 2154 2015-04-12 21:51 CRM\src\com\crm\auth\dao\impl\UserDaoImpl.java
文件 444 2015-04-13 15:20 CRM\src\com\crm\auth\dao\RoleDao.java
文件 428 2015-04-14 19:15 CRM\src\com\crm\auth\dao\RoleRightDao.java
文件 497 2015-04-12 17:39 CRM\src\com\crm\auth\dao\UserDao.java
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\entity\
文件 897 2015-04-14 18:18 CRM\src\com\crm\auth\entity\Right.hbm.xm
文件 1188 2015-04-14 18:15 CRM\src\com\crm\auth\entity\Right.java
文件 826 2015-04-09 14:30 CRM\src\com\crm\auth\entity\Role.hbm.xm
文件 808 2015-04-07 23:41 CRM\src\com\crm\auth\entity\Role.java
文件 602 2015-04-09 14:30 CRM\src\com\crm\auth\entity\Role_Right.hbm.xm
文件 470 2015-04-09 14:36 CRM\src\com\crm\auth\entity\Role_Right.java
文件 705 2015-04-08 02:22 CRM\src\com\crm\auth\entity\User.hbm.xm
文件 665 2015-04-07 22:29 CRM\src\com\crm\auth\entity\User.java
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\service\
目录 0 2015-04-15 14:04 CRM\src\com\crm\auth\service\impl\
............此处省略665个文件信息
评论
共有 条评论