I have a problem with the warning: Could not resolve NavigationCase for outcome:...
.
com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNUNG: JSF1064: Resource /common-content.xhtml not resolvable
The warning does not seem to have any
affect to my application since i leverage the implicit navigation using JSF 2 with Mojarra 2.2.8 and Primefaces 3.5. I didn't define any navigation-case
within the faces-config.xml
The interesting thing about it, is that navigation itself works properly, but the warning is added to the Faces message queue and therefor shown within any message after a request.
The following code shows my home.xhtml which
<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>
The page just includes the appropriate compositions. I think here is the problem. The outcome is always home.xhtml the pages referenced by the JSF warning are just compositions.
Edit:
The backing bean impementation of mainContentController
:
@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;
}
}