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