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

📄 actionfactory.java

📁 很全面的hrm管理。提供通用的企业人力资源管理。
💻 JAVA
字号:
package org.self.hrm.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;

import org.self.hrm.common.Constant;
import org.self.hrm.model.Action;
import org.self.hrm.model.User;
import org.self.hrm.service.system.IActionService;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class ActionFactory {
	public static List<Action> getActions(PageContext pageContext) {
		String pagePath = ((HttpServletRequest)pageContext.getRequest()).getServletPath();
		ApplicationContext appContext =  WebApplicationContextUtils.getRequiredWebApplicationContext(pageContext.getServletContext());
		IActionService actionService = (IActionService) appContext.getBean(Constant.SERVICE_ACTION);
		User user = (User) pageContext.getSession().getAttribute(Constant.SESSION_USER);
		if(pagePath != null && user != null){
			return actionService.getPageAllowed(pagePath, user.getId());
		}
		return new ArrayList<Action>(0);
	}
}

⌨️ 快捷键说明

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