本文整理汇总了Java中javax.faces.application.ConfigurableNavigationHandler类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableNavigationHandler类的具体用法?Java ConfigurableNavigationHandler怎么用?Java ConfigurableNavigationHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurableNavigationHandler类属于javax.faces.application包,在下文中一共展示了ConfigurableNavigationHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkCart
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
public void checkCart(ComponentSystemEvent event) {
if (logger.isDebugEnabled()) logger.debug("in check cart");
FacesContext fc = FacesContext.getCurrentInstance();
ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler();
if (this.cart.isEmpty()) {
if (logger.isDebugEnabled()) logger.debug("go direct to logout");
HttpServletRequest req = (HttpServletRequest) FacesContext
.getCurrentInstance().getExternalContext().getRequest();
HttpServletResponse res = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
try {
res.sendRedirect("finish-logout.xhtml");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
开发者ID:TremoloSecurityRetired,项目名称:Scale,代码行数:20,代码来源:ScaleUser.java
示例2: handle
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
public void handle() throws FacesException {
final Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator();
while (i.hasNext()) {
ExceptionQueuedEvent event = i.next();
ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
Throwable t = context.getException();
final FacesContext fc = FacesContext.getCurrentInstance();
final ExternalContext externalContext = fc.getExternalContext();
final ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler();
try {
log.error(t.getMessage(), t);
performRedirect(externalContext, "/error_service");
fc.renderResponse();
} finally {
i.remove();
}
}
getWrapped().handle();
}
开发者ID:GluuFederation,项目名称:oxAuth,代码行数:22,代码来源:GlobalExceptionHandler.java
示例3: getNavigationCases
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
@Override
public Map<String, Set<NavigationCase>> getNavigationCases()
{
Map<String, Set<NavigationCase>> result = null;
if (this.wrapped instanceof ConfigurableNavigationHandler)
{
result = ((ConfigurableNavigationHandler) this.wrapped).getNavigationCases();
}
if (result == null)
{
result = new HashMap<String, Set<NavigationCase>>();
}
if (!this.activated)
{
return result;
}
return new NavigationCaseMapWrapper(result, this.wrapped);
}
开发者ID:apache,项目名称:deltaspike,代码行数:23,代码来源:DeltaSpikeNavigationHandler.java
示例4: wrapNavigationHandlerWithNewWrapper
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
private NavigationHandler wrapNavigationHandlerWithNewWrapper(NavigationHandler handler)
{
if (ConfigurableNavigationHandler.class.isAssignableFrom(handler.getClass()))
{
try
{
Constructor deltaSpikeNavigationHandlerWrapperConstructor =
this.navigationHandlerWrapperClass.getConstructor(ConfigurableNavigationHandler.class);
NavigationHandler navigationHandlerWrapper =
(NavigationHandler)deltaSpikeNavigationHandlerWrapperConstructor.newInstance(handler);
return navigationHandlerWrapper;
}
catch (Exception e)
{
throw ExceptionUtils.throwAsRuntimeException(e);
}
}
return null;
}
开发者ID:apache,项目名称:deltaspike,代码行数:22,代码来源:NavigationHandlerAwareApplication.java
示例5: getNavigationCase
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/**
* @param context
* @param fromAction
* @param outcome
* @return
*/
@Override
public NavigationCase getNavigationCase(FacesContext context,
String fromAction, String outcome) {
if (parent instanceof ConfigurableNavigationHandler) {
return ((ConfigurableNavigationHandler) parent).getNavigationCase(
context, fromAction, outcome);
} else {
return null;
}
}
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:RedirectNavigationHandler.java
示例6: getNavigationCases
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/**
* @return
*/
@Override
public Map<String, Set<NavigationCase>> getNavigationCases() {
if (parent instanceof ConfigurableNavigationHandler) {
return ((ConfigurableNavigationHandler) parent)
.getNavigationCases();
} else {
return null;
}
}
开发者ID:servicecatalog,项目名称:oscm,代码行数:13,代码来源:RedirectNavigationHandler.java
示例7: getNavigationCase
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
@Override
public NavigationCase getNavigationCase(FacesContext context, String fromAction,
String outcome)
{
if (!(_delegate instanceof ConfigurableNavigationHandler))
return null;
return ((ConfigurableNavigationHandler)_delegate).getNavigationCase(context, fromAction, outcome);
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:10,代码来源:NavigationHandlerImpl.java
示例8: getNavigationCases
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
@Override
public Map<String, Set<NavigationCase>> getNavigationCases()
{
if (!(_delegate instanceof ConfigurableNavigationHandler))
return _emptyCaces;
return ((ConfigurableNavigationHandler)_delegate).getNavigationCases();
}
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:NavigationHandlerImpl.java
示例9: determineTargetURL
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/**
* Translate the outcome attribute value to the target URL.
*
* @param context
* the current FacesContext
* @param outcome
* the value of the outcome attribute
* @return the target URL of the navigation rule (or the outcome if there's
* not navigation rule)
*/
private String determineTargetURL(FacesContext context, Button button, String outcome) {
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
.getNavigationHandler();
NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
/*
* Param Name: javax.faces.PROJECT_STAGE Default Value: The default
* value is ProjectStage#Production but IDE can set it differently in
* web.xml Expected Values: Development, Production, SystemTest,
* UnitTest Since: 2.0
*
* If we cannot get an outcome we use an Alert to give a feedback to the
* Developer if this build is in the Development Stage
*/
if (navCase == null) {
if (FacesContext.getCurrentInstance().getApplication().getProjectStage().equals(ProjectStage.Development)) {
return "alert('WARNING! " + C.W_NONAVCASE_BUTTON + "');";
} else {
return "";
}
} // throw new FacesException("The outcome '"+outcome+"' cannot be
// resolved."); }
String vId = navCase.getToViewId(context);
Map<String, List<String>> params = getParams(navCase, button);
String url;
url = context.getApplication().getViewHandler().getBookmarkableURL(context, vId, params,
button.isIncludeViewParams() || navCase.isIncludeViewParams());
return url;
}
开发者ID:stephanrauh,项目名称:JSFLibraryGenerator,代码行数:40,代码来源:ButtonRenderer.java
示例10: getNavigationCase
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/** Calls the default implementation */
@Override
public NavigationCase getNavigationCase(FacesContext context,
String fromAction, String outcome) {
if (wrappedNavigationHandler instanceof ConfigurableNavigationHandler) {
return ((ConfigurableNavigationHandler) wrappedNavigationHandler)
.getNavigationCase(context, fromAction, outcome);
} else {
return null;
}
}
开发者ID:stephanrauh,项目名称:JSF-on-Spring-Boot,代码行数:12,代码来源:BeyondViewScopeNavigationHandler.java
示例11: getNavigationCases
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/** Calls the default implementation */
@Override
public Map<String, Set<NavigationCase>> getNavigationCases() {
if (wrappedNavigationHandler instanceof ConfigurableNavigationHandler) {
return ((ConfigurableNavigationHandler) wrappedNavigationHandler)
.getNavigationCases();
} else {
return null;
}
}
开发者ID:stephanrauh,项目名称:JSF-on-Spring-Boot,代码行数:11,代码来源:BeyondViewScopeNavigationHandler.java
示例12: encodeHref
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
private String encodeHref(FacesContext context, AbstractNavLink navlink) {
String href = navlink.getHref();
String url;
if (href != null) {
url = getResourceURL(context, href);
return url;
} else {
String outcome = navlink.getOutcome();
if (outcome==null) {
return null;
}
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
.getNavigationHandler();
NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
if (navCase == null) {
return null;
}
String vId = navCase.getToViewId(context);
Map<String, List<String>> params = getParams(navCase, navlink);
url = context.getApplication().getViewHandler().getBookmarkableURL(context, vId, params,
navlink.isIncludeViewParams() || navCase.isIncludeViewParams());
if (url != null) {
String frag = navlink.getFragment();
if (frag != null) {
url += "#" + frag;
}
return url;
} else {
return "#";
}
}
}
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:40,代码来源:NavLinkRenderer.java
示例13: handle
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
public void handle() throws FacesException {
final Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator();
while (i.hasNext()) {
ExceptionQueuedEvent event = i.next();
ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
Throwable t = context.getException();
final FacesContext fc = FacesContext.getCurrentInstance();
final ExternalContext externalContext = fc.getExternalContext();
final ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler();
try {
if (isSecurityException(t)) {
performRedirect(externalContext, "/login");
} else if (isConversationException(t)) {
log.error(t.getMessage(), t);
performRedirect(externalContext, "/conversation_error");
} else {
log.error(t.getMessage(), t);
performRedirect(externalContext, "/error");
}
fc.renderResponse();
} finally {
i.remove();
}
}
getWrapped().handle();
}
开发者ID:GluuFederation,项目名称:oxTrust,代码行数:29,代码来源:GlobalExceptionHandler.java
示例14: requireLogin
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/** ログイン済みで無い場合、ログインページへリダイレクト */
public void requireLogin() {
if (!isLoggedin()) {
ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler)
FacesContext.getCurrentInstance()
.getApplication().getNavigationHandler();
handler.performNavigation("index.xhtml?faces-redirect=true");
}
}
开发者ID:enterprisegeeks,项目名称:try_java_ee7,代码行数:11,代码来源:LoginListener.java
示例15: skipLogin
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/** ログイン済みでログインページにきた場合は、ログイン後ページへリダイレクト */
public void skipLogin() {
if(isLoggedin()) {
ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler)
FacesContext.getCurrentInstance()
.getApplication().getNavigationHandler();
handler.performNavigation("chatroom.xhtml?faces-redirect=true");
}
}
开发者ID:enterprisegeeks,项目名称:try_java_ee7,代码行数:11,代码来源:LoginListener.java
示例16: init
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
public void init(ComponentSystemEvent e){
log.info("call init");
log.info("flag @"+ flag);
if(!FacesContext.getCurrentInstance().isPostback()){
//initialized some data...but avoid loading in postback request
}
if("page2".equals(flag)){
ConfigurableNavigationHandler handler=(ConfigurableNavigationHandler)
FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
handler.performNavigation("page2");
}
}
开发者ID:hantsy,项目名称:ee7-sandbox,代码行数:15,代码来源:PreRenderViewBean.java
示例17: DelegatingSet
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
private DelegatingSet(Collection<? extends NavigationCase> c,
ConfigurableNavigationHandler wrapped,
String navigationCaseKey)
{
super(c);
this.wrapped = wrapped;
this.navigationCaseKey = navigationCaseKey;
}
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:NavigationCaseMapWrapper.java
示例18: directNavigate
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
/**
* Directly navigate to a given result
* @param navigation The navigation result
*/
public void directNavigate(String navigation) {
ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
nav.performNavigation(navigation);
}
开发者ID:BjerknesClimateDataCentre,项目名称:QuinCe,代码行数:9,代码来源:BaseManagedBean.java
示例19: redirectTo
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
protected void redirectTo(final Navigation navigation) {
final ConfigurableNavigationHandler configurableNavigationHandler
= (ConfigurableNavigationHandler) FacesContext.getCurrentInstance()
.getApplication().getNavigationHandler();
configurableNavigationHandler.performNavigation(navigation.getView());
}
开发者ID:noveogroup,项目名称:clap,代码行数:7,代码来源:BaseController.java
示例20: getNavigationHandler
import javax.faces.application.ConfigurableNavigationHandler; //导入依赖的package包/类
private static ConfigurableNavigationHandler getNavigationHandler(){
FacesContext context = FacesContext.getCurrentInstance();
return (ConfigurableNavigationHandler) context
.getApplication().getNavigationHandler();
}
开发者ID:PE-INTERNATIONAL,项目名称:soda4lca,代码行数:6,代码来源:FacesUtils.java
注:本文中的javax.faces.application.ConfigurableNavigationHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论