當我們聲明一個dominoDocument作爲XPage數據源時,我們可以指定documentid programmaticaly。但是,如果指定的ID不存在,我還沒有找到陷阱錯誤的方法。我收到錯誤500 /無法在日誌上打開文檔錯誤。XPages Domino文檔數據源和documentid:如何捕獲錯誤?
我會exxt得到一個空的「document1」或東西,但能夠很好地捕捉錯誤。
<xp:this.data>
<xp:dominoDocument var="document1" action="openDocument" documentId="some noteId here" formName="Document" ignoreRequestParams="true">
<xp:this.databaseName>...</xp:this.databaseName>
</xp:dominoDocument>
</xp:this.data>
任何提示?
感謝
只是一個想法,你可以嘗試使用queryOpenDocument來檢查文檔是否存在,並可能計算documentId屬性的另一個值 –