Uyarı ile ilgili bir sorunum var: Could not resolve NavigationCase for outcome:...
.JSF uyarısı nasıl tetiklenir: Sonucu için NavigationCase çözümlenemedi: puh-repair.xhtml
com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNUNG: JSF1064: Resource /common-content.xhtml not resolvable
uyarı i Mojarra 2.2.8 ve Primefaces 3.5 JSF 2 kullanılarak örtük navigasyon kaldıraç beri herhangi benim uygulamaya etkileyecek olması gibi görünmüyor. Bu konuda faces-config.xml
ilginç şey içinde herhangi navigasyon-durum tanımlamak vermedi kendisi düzgün çalıştığından emin navigasyon, ancak uyarı Yüzler mesajı kuyruğuna eklenir ve bunun bir talebe sonra herhangi iletinin içinde gösterilen.
Aşağıdaki kod
<h:body class="page-container">
<p:growl id="message"></p:growl>
<div class="page-layout-container">
<div>
<ui:insert name="header">
<ui:include src="/template/puh-common-header.xhtml" />
</ui:insert>
</div>
<div>
<ui:insert name="menu">
<ui:include src="/template/puh-menu.xhtml" />
</ui:insert>
</div>
<div>
<h:panelGroup id="content" layout="block">
<ui:insert name="content">
<ui:include src="/main-content/#{mainContentController.getContent()}"/>
</ui:insert>
</h:panelGroup>
</div>
<div>
<ui:insert name="footer">
<ui:include src="/template/puh-common-footer.xhtml" />
</ui:insert>
</div>
</div>
</h:body>
sayfa sadece uygun kompozisyonlar içerir benim home.xhtml gösterir. Bence sorun bu. Sonuç her zaman home.xhtml JSF uyarısı tarafından başvurulan sayfalar sadece kompozisyonlardır.
Düzenleme:
mainContentController
ait destek fasulye impementation:
@Named("mainContentController")
@SessionScoped
public class MainContentController implements Serializable {
/**
*
*/
private static final long serialVersionUID = -6818446964735212239L;
private Logger logger = LogManager.getLogger(MainContentController.class);
public static String PAGE_HOME = "puh-home.xhtml";
public static final String CONTENT_ERROR = "puh-error.xhtml";
public static String CONTENT_COMMON = "puh-common-content.xhtml";
public static String CONTENT_CONTACT = "puh-contact.xhtml";
public static String CONTENT_REPAIR = "puh-repair.xhtml";
public static String CONTENT_IMPRESSUM = "puh-impressum.xhtml";
private String content = CONTENT_COMMON;
private void showControllerState() {
logger.info("Page "+ content + ".");
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Page "+ content + "."));
}
public String homeAction() {
content = CONTENT_COMMON;
showControllerState();
return content;
}
public String serviceAction() {
content = CONTENT_REPAIR;
showControllerState();
return content;
}
public String impressumAction() {
content = CONTENT_IMPRESSUM;
showControllerState();
return content;
}
public String contactAction() {
content = CONTENT_CONTACT;
FacesContext facesContext = FacesContext.getCurrentInstance();
String outcome = PAGE_HOME+"?faces-redirect=true"; // Do your thing?
// Because of Captcha Image
facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, null, outcome);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Redirect "+ content + "."));
showControllerState();
return content;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}