當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。