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


Java Application.getNavigationHandler方法代码示例

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


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

示例1: logout

import javax.faces.application.Application; //导入方法依赖的package包/类
public void logout() {
        FacesContext fc = javax.faces.context.FacesContext.getCurrentInstance();
        ((HttpSession) fc.getExternalContext().getSession(false)).invalidate();
//        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().clear();        
        Application ap = fc.getApplication();
        NavigationHandler nh = ap.getNavigationHandler();
        //Generate Logout Dialog
        List<String> buttonTextList = new ArrayList<String>();
        buttonTextList.add(resolve("Login", new Object[]{}));
        NotifyDescriptorExt n = new NotifyDescriptorExt(Constants.INFORMATION_ICON, resolve("Logouted", new Object[]{}), resolve("LogoutMessage", new Object[]{}), buttonTextList);
        String page = n.setCallbackListener(new ButtonListener() {

            public String buttonClicked(final int buttonId, NotifyDescriptorExtBean notifyDescriptorBean) {
                return NavigationEnum.controller_CenterPanel.toString();
            }
        });
        //Load the NotifyDescriptor because after logout the JSF logic is expired.
        nh.handleNavigation(fc, null, page);
    }
 
开发者ID:salimvanak,项目名称:myWMS,代码行数:20,代码来源:JSFHelper.java

示例2: gotoPage

import javax.faces.application.Application; //导入方法依赖的package包/类
/**
 * redirects to the specified page
 * @param page the name of the page to go to
 */
public void gotoPage(String page) {
    Application app = getApplication() ;
    if (app != null) {
        NavigationHandler navigator = app.getNavigationHandler();
        navigator.handleNavigation(getFacesContext(), null, page);
    }

    // if app is null, session has been destroyed
    else {
        try {
            FacesContext.getCurrentInstance().getExternalContext().redirect("Login.jsp");
        }
        catch (IOException ioe) {
            // message about destroyed app
        }
    }
}
 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:22,代码来源:SessionBean.java

示例3: gotoPage

import javax.faces.application.Application; //导入方法依赖的package包/类
/**
 * redirects to the specified page
 * @param page the name of the page to go to
 */
public void gotoPage(String page) {
    Application app = getApplication() ;
    if (app != null) {
        NavigationHandler navigator = app.getNavigationHandler();
        navigator.handleNavigation(getFacesContext(), null, page);
    }

    // if app is null, session has been destroyed
    else {
        try {
            FacesContext.getCurrentInstance().getExternalContext().redirect("msLogin.jsp");
        }
        catch (IOException ioe) {
            // message about destroyed app
        }
    }
}
 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:22,代码来源:SessionBean.java

示例4: setUp

import javax.faces.application.Application; //导入方法依赖的package包/类
/**
 * このオブジェクトをJSFのNavigation Handlerとして設定する.
 * @param helper
 *            JSFヘルパー
 */
public void setUp(FacesHelper helper) {
    Application app = helper.getContext().getApplication();
    NavigationHandler org = app.getNavigationHandler();
    if (!(org instanceof ExtendedNavigationHandler)) {
        orgHandler = org;
        app.setNavigationHandler(this);
    }
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:14,代码来源:ExtendedNavigationHandler.java

示例5: showResults

import javax.faces.application.Application; //导入方法依赖的package包/类
/**
 * Show results.
 * 
 * @throws Exception
 *           the exception
 */
protected void showResults() throws Exception {
  FacesContextBroker broker = new FacesContextBroker();
  String dispatchTo = "";
  String tagName = "com.esri.gpt.control.filter.EncodingFilterTag";
  // will prevent going to front page
  this.getRequestContext().addToSession(tagName, "tag");
  HttpServletRequest httpReq = broker.extractHttpServletRequest();
  HttpServletResponse httpResp = broker.extractHttpServletResponse();
  FacesContext fctx = broker.getFacesContext();
  Application application = fctx.getApplication();
  
  if (this.isResultsOnly()) {
    dispatchTo = SEARCH_RESULTS_PAGE;

  } else {
  
    // TODO: Glassfish does not support this section (f=searchpage)
    NavigationHandler navHandler = application.getNavigationHandler();
    navHandler.handleNavigation(fctx, null, "catalog.search.results");
    dispatchTo = fctx.getViewRoot().getViewId();

    String jsfSuffix = SearchConfig.getConfiguredInstance().getJsfSuffix();
    if ("".equals(jsfSuffix)) {
      jsfSuffix = ".page";
    }
    if (jsfSuffix.indexOf('.') < 0) {
      jsfSuffix = "." + jsfSuffix;
    }
    //javax.faces.DEFAULT_SUFFIX 
    dispatchTo = dispatchTo.replaceAll(".jsp", jsfSuffix);
    //ViewHandler.DEFAULT_SUFFIX_PARAM_NAME = jsfSuffix; 
    //fctx.getExternalContext().dispatch(dispatchTo);
    //httpReq.getRequestDispatcher( dispatchTo).forward(httpReq, httpResp);
      
 
  }

  
  // Synching criteria with session criteria in thread so that search result
  // does
  // not have to wait for synch to complete.
  setExtraCriteriaProperties(httpReq);
  SynchSessionCriteria synchSc = new SynchSessionCriteria(criteria, this
      .readSessionCriteria());
  synchSc.synch();
  //Thread thread = new Thread(synchSc);
  //thread.start();
  jsfDispatchPage(fctx, dispatchTo);
 
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:57,代码来源:HtmlAdvancedWriter.java


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