我有一个popup log.xhtml,用于轮询服务器以显示文件的内容,并与一个名为logTailer的组件进行交互。
以下消息每2秒写入日志:
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(WARN 1), summary=(View: log.xhtml not found in component), detail=(View: log.xhtml not found in component)]
我想我可以添加<h:messages>
来显示实际错误,但为什么会这样?
代码:
<script type="text/javascript">
function scrollToBottom(elemId) {
var textarea = document.getElementById(elemId);
textarea.scrollTop = textarea.scrollHeight;
}
</script>
<rich:tabPanel width="100%" height="100%">
<rich:tab label="XStreamlineapp">
<h:form id="logForm" style="width: 100%; height: 100%;">
<a:poll id="appPoll" interval="4000"
enabled="#{logTailer.appPollEnabled}" reRender="logTail,logTailSum"
oncomplete="scrollToBottom('logForm:logTail');" />
<s:div style="width: 100%; height: 100%;">
<h:panelGrid columns="3">
<h:outputText id="logTailSum"
value="#{sl:formatString(messages['logPopup.summary'],logTailer.appLogTail[1],logTailer.appLogTail[2])}"
styleClass="dr-tbpnl-cntnt" style="border:none" />
<a:commandLink id="appControl" reRender="appPoll,appControl">
<h:graphicImage
value="#{logTailer.appPollEnabled ? '/icons/control_pause.png' : '/icons/control_play.png'}"
title="#{logTailer.appPollEnabled ? messages['logPopup.pause'] : messages['logPopup.play']}"
style="vertical-align:middle;" />
<a:actionparam name="polling"
value="#{not logTailer.appPollEnabled}"
assignTo="#{logTailer.appPollEnabled}" />
</a:commandLink>
<h:graphicImage value="/icons/email.png"
title="#{messages['logPopup.email']}"
onclick="populateEmailBody('','logForm:logTail')"
style="vertical-align:middle; cursor:pointer" />
</h:panelGrid>
<h:inputTextarea
style="border: 3px solid #cccccc; width: 100%; height: 96%;"
id="logTail" value="#{logTailer.appLogTail[0]}" readonly="true" />
</s:div>
</h:form>
</rich:tab>
<rich:tab label="XStreamlinedata">
<h:form id="logDataForm" style="width: 100%; height: 100%;">
<a:poll id="dataPoll" interval="4000" enabled="true"
reRender="logDataTail,logDataTailSum"
oncomplete="scrollToBottom('logDataForm:logDataTail');" />
<s:div style="width: 100%; height: 100%;">
<h:panelGrid columns="3">
<h:outputText id="logDataTailSum"
value="#{sl:formatString(messages['logPopup.summary'],logTailer.dataLogTail[1],logTailer.dataLogTail[2])}"
styleClass="dr-tbpnl-cntnt" style="border:none" />
<a:commandLink id="dataControl" reRender="dataPoll,dataControl">
<h:graphicImage
value="#{logTailer.dataPollEnabled ? '/icons/control_pause.png' : '/icons/control_play.png'}"
title="#{logTailer.dataPollEnabled ? messages['logPopup.pause'] : messages['logPopup.play']}"
style="vertical-align:middle;" />
<a:actionparam name="dataPolling"
value="#{not logTailer.dataPollEnabled}"
assignTo="#{logTailer.dataPollEnabled}" />
</a:commandLink>
<h:graphicImage value="/icons/email.png"
title="#{messages['logPopup.email']}"
onclick="populateEmailBody('','logDataForm:logDataTail')"
style="vertical-align:middle; cursor:pointer" />
</h:panelGrid>
<h:inputTextarea
style="border: 3px solid #cccccc; width: 100%; height: 98%;"
id="logDataTail" value="#{logTailer.dataLogTail[0]}"
readonly="true" />
</s:div>
</h:form>
</rich:tab>
</rich:tabPanel>
涉及很多facelets模板。这是具有打开弹出窗口的链接的那个。这是因为我应该在同一个视图中有两个模板吗?
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:sl="http://volantice.com/streamline">
<script type="text/javascript">
function openLogPopup(){
h = jQuery(document).height();
w = jQuery(document).width();
l = w/2;
t = 0;
window.open('/studio/admin/log.seam', 'LogTailer', 'dependent=yes, menubar=no, toolbar=no, ' + 'width=' + w/2 + ', height=' + h/2 + ', left=' + l + 'top=' + t);
}
</script>
<s:div id="header" style="#{headerStyle}">
<h:form prependId="false">
<s:div id="banner">
<s:div id="loginStatus" style="float: right">
<sl:ajaxStatus />
<sl:languageMenu />
<sl:processAreaMenu />
<c:if test="#{identity.isLoggedIn(false) and (not param.embedded)}">
<sl:logoutMenu />
<sl:zoneMenu />
<sl:zoneSearch />
</c:if>
<h:outputLink onclick="openLogPopup(); return false;" value="#"
rendered="#{s:hasRole('Developer') or s:hasRole('Administrator')}">
<h:graphicImage value="/icons/bug.png"
title="#{messages['logPopup.open']}"
alt="#{messages['logPopup.open']}"
style="vertical-align:middle; margin-top:3px;" />
</h:outputLink>
</s:div>
</s:div>
<c:if test="#{not param.embedded}">
<sl:zonePages />
</c:if>
</h:form>
</s:div>