actionfactory.java
来自「很全面的hrm管理。提供通用的企业人力资源管理。」· Java 代码 · 共 28 行
JAVA
28 行
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 + =
减小字号Ctrl + -
显示快捷键?