Thou should not perform business logic in getter methods. It's only recipe for trouble in all colors. Getter methods are supposed to solely return already-prepared properties. Just use a pre render view event listener instead.
E.g.
<f:event type="preRenderView" listener="#{common.initCurrentPage}" />
<h:panelGroup layout="block">
<h:outputText escape="false" value="#{common.currentPage.cmsPageBody}"/>
</h:panelGroup>
with
public void initCurrentPage() throws IOException {
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
String requestUrl = (String) ec.getRequestMap().get(RequestDispatcher.FORWARD_REQUEST_URI);
if (currentCmsPage == null) {
// Page not found. Default to the home page.
currentCmsPage = cmsPageBL.getCmsPage("/en/index.html", websiteId);
} else {
currentCmsPage = cmsPageBL.getCmsPage(requestUrl, websiteId);
}
if (currentCmsPage == null) {
ec.redirect(ec.getRequestContextPath() + "/404.xhtml");
}
}
public CmsPage getCurrentPage() {
return currentCmsPage;
}
Note that I also improved some poor logic.