⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moduleaction.java

📁 struts2 spring2.5 jpa hibernate 权限管理系统源代码
💻 JAVA
字号:
package sunyang.module.action;

import java.util.*;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import sunyang.module.domain.Module;
import sunyang.module.service.IModuleFacade;

import com.opensymphony.xwork2.Action;

public class ModuleAction {
	// 针对于页面的成员变量
	private Module m;
	private List<Module> lm;
	private IModuleFacade mf;

	// 构造方法,用于对成员变量赋初值
	public ModuleAction() {
		m = new Module();
		lm=new ArrayList<Module>();
	}

	// getter和setter方法
	public Module getM() {
		return m;
	}

	public void setM(Module m) {
		this.m = m;
	}

	public List<Module> getLm() {
		return lm;
	}

	public void setLm(List<Module> lm) {
		this.lm = lm;
	}

	public IModuleFacade getMf() {
		return mf;
	}

	public void setMf(IModuleFacade mf) {
		this.mf = mf;
	}

	// 处理findModule请求的方法
	@SuppressWarnings("unchecked")
	public String findModule() {
		HttpSession hs = ServletActionContext.getRequest().getSession();
		lm = mf.findModule((List<Integer>) hs.getAttribute("role"));
		return Action.SUCCESS;
	}

	// 处理newModule请求的方法
	public String newModule() {
		mf.newModule(m);
		return Action.SUCCESS;
	}

	// 处理findSingleModule请求的方法
	public String findSingleModule() {
		m = mf.findSingleModule(m.getId());
		return Action.SUCCESS;
	}

	// 处理modifyModule请求的方法
	public String modifyModule() {
		mf.modifyModule(m);
		return Action.SUCCESS;
	}

	// 处理operateModule请求的方法
	public String operateModule() {
		lm = mf.operateModule();
		return Action.SUCCESS;
	}

	// 处理removeModule请求的方法
	public String removeModule() {
		mf.removeModule(m);
		return Action.SUCCESS;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -