本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}