当前位置: 首页>>代码示例>>Java>>正文


Java ViewExpiredException.getViewId方法代码示例

本文整理汇总了Java中javax.faces.application.ViewExpiredException.getViewId方法的典型用法代码示例。如果您正苦于以下问题:Java ViewExpiredException.getViewId方法的具体用法?Java ViewExpiredException.getViewId怎么用?Java ViewExpiredException.getViewId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.application.ViewExpiredException的用法示例。


在下文中一共展示了ViewExpiredException.getViewId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleViewExpiredException

import javax.faces.application.ViewExpiredException; //导入方法依赖的package包/类
private void handleViewExpiredException(ViewExpiredException vee) {
    LOG.log(Level.INFO, " handling viewExpiredException...");
    FacesContext context = FacesContext.getCurrentInstance();
    String viewId = vee.getViewId();
    LOG.log(Level.INFO, "view id @" + viewId);
    NavigationHandler nav
            = context.getApplication().getNavigationHandler();
    nav.handleNavigation(context, null, viewId);
    context.renderResponse();
}
 
开发者ID:hantsy,项目名称:javaee8-jsf-sample,代码行数:11,代码来源:DefaultExceptionHandler.java

示例2: handle

import javax.faces.application.ViewExpiredException; //导入方法依赖的package包/类
@Override
public void handle() throws FacesException {
    for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {
        ExceptionQueuedEvent event = i.next();
        ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
        Throwable t = context.getException();
        if (t instanceof ViewExpiredException) {
            ViewExpiredException vee = (ViewExpiredException) t;
            LOG.log(Level.WARNING, "View Expired {0}", vee.getViewId());
            FacesContext fc = FacesContext.getCurrentInstance();
            NavigationHandler nav = fc.getApplication().getNavigationHandler();
            try {
                String navigation = vee.getViewId();
                if ("jobs/index.xhtml".equals(vee.getViewId())){
                    navigation += "?faces-redirect=true";
                }
                nav.handleNavigation(fc, null, navigation);
                fc.renderResponse();

            } finally {
                i.remove();
            }
        }
    }
    // At this point, the queue will not contain any ViewExpiredEvents.
    // Therefore, let the parent handle them.
    getWrapped().handle();

}
 
开发者ID:vodev,项目名称:vocloud,代码行数:30,代码来源:ViewExpiredExceptionHandler.java

示例3: handleViewExpiredException

import javax.faces.application.ViewExpiredException; //导入方法依赖的package包/类
private void handleViewExpiredException(ViewExpiredException vee) {
    log.log(Level.INFO, " handling viewExpiredException...");
    FacesContext context = FacesContext.getCurrentInstance();
    String viewId = vee.getViewId();
    log.log(Level.INFO, "view id @" + viewId);
    NavigationHandler nav
            = context.getApplication().getNavigationHandler();
    nav.handleNavigation(context, null, viewId);
    context.renderResponse();
}
 
开发者ID:hantsy,项目名称:ee7-sandbox,代码行数:11,代码来源:DefaultExceptionHandler.java

示例4: handleViewExpiredException

import javax.faces.application.ViewExpiredException; //导入方法依赖的package包/类
private void handleViewExpiredException(ViewExpiredException vee) {
    log.debug(" handling viewExpiredException...");
    FacesContext context = FacesContext.getCurrentInstance();
    String viewId = vee.getViewId();
    log.debug("view id @" + viewId);
    NavigationHandler nav =
            context.getApplication().getNavigationHandler();
    nav.handleNavigation(context, null, viewId);
    context.renderResponse();
}
 
开发者ID:hantsy,项目名称:spring4-sandbox,代码行数:11,代码来源:DefaultExceptionHandler.java


注:本文中的javax.faces.application.ViewExpiredException.getViewId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。