我使用 NavigationHandler#navigationHandler 重定向到其他页面,但在它触发调用的 init() 方法(@PostConstruct)时。为什么?
public void onRowSelect(SelectEvent event) throws IOException {
long time = System.currentTimeMillis();
System.out.println("JSF : QuestionnaireListBean : onRowSelect(SelectEvent event)");
FacesContext context = FacesContext.getCurrentInstance();
context.getExternalContext().getApplicationMap().put("questionnaireId", selectedQuestionnaire.getQuestionnaireId());
NavigationHandler navigationHandler = context.getApplication().getNavigationHandler();
navigationHandler.handleNavigation(context, null, "/views/questionnaires/viewDetails.xhtml?faces-redirect=true&includeViewParams=true&questionnaireId=" + selectedQuestionnaire.getQuestionnaireId());
System.out.println("JSF : QuestionnaireListBean : onRowSelect(SelectEvent event) time = " + (System.currentTimeMillis() - time) + "ms");
}