首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JSF项目中兑现基于RBAC模型的权限管理设计(二) 转

2012-12-27 
JSF项目中实现基于RBAC模型的权限管理设计(二) 转4.3lifecycle?????package com.laomao.view.listeneri

JSF项目中实现基于RBAC模型的权限管理设计(二) 转

4.3

<lifecycle>?????

package com.laomao.view.listener;

importimportimportimportimportimportimportimportimportimport?

public???

??????

??????????????????????????????????????????????????????????????????????

??????????????????????????????????????????????????????

??????????????????????????????????????????????

????????????????????????????????????????????

????????????????????????}

?

?

????????

<application>??</application>

?

步骤二:实现我们自己的ActionListener接口

package com.laomao.view.listener;

import javax.el.ELContext;

import javax.el.MethodExpression;

import javax.faces.FacesException;

import javax.faces.application.Application;

import javax.faces.application.NavigationHandler;

import javax.faces.component.ActionSource2;

import javax.faces.context.FacesContext;

import javax.faces.el.EvaluationException;

import javax.faces.el.MethodBinding;

import javax.faces.event.AbortProcessingException;

import javax.faces.event.ActionEvent;

import javax.faces.event.ActionListener;

import org.apache.commons.logging.Log;

import org.apache.commons.logging.LogFactory;

?

public class ActionListenerImpl implements ActionListener {

??????

???????????????

??????????????????????????????

???????????????

????????????}

????????}

?

????????NavigationHandler navigationHandler = application.getNavigationHandler();

????????navigationHandler.handleNavigation(facesContext,fromAction,outcome);

????????//Render Response if needed

????????facesContext.renderResponse();

?

???????}

??????

???????/**

????????*?转入无权限声明页面

????????* @param expression

????????*/

???????private void gotoNoPermissionPage(MethodExpression expression) {

????????FacesContext context = FacesContext.getCurrentInstance();

????????Application application = context.getApplication();

???????????????

????????NavigationHandler navHandler = application.getNavigationHandler();

????????navHandler.handleNavigation(context, null == expression ? null : expression.getExpressionString(), Constants.NAVIGATION_NO_PERMISSION);

????????context.renderResponse();

????}

?

}

?

转:http://laomaowww.blog.163.com/blog/static/16600567320124751827427/

热点排行
Bad Request.