我在托管 bean 中有代码:
public void setTestProp(String newProp) {
FacesMessage yourFailure = new FacesMessage();
yourFailure.setDetail("Really you need to promise to never do that again!");
yourFailure.setSummary("Stop here, now!");
yourFailure.setSeverity(FacesMessage.SEVERITY_FATAL);
throw new ValidatorException(yourFailure);
}
在 XPage 中:
<xp:messages id="messages1" layout="table" showSummary="false"
showDetail="true" globalOnly="false">
</xp:messages>
但我得到了结果消息(如预期的那样很好地在黄色框中,而不是在错误页面中):
Error setting property 'testProp' in bean of type com.ibm.sg.demo.Test: javax.faces.validator.ValidatorException: Stop here, now!
我想:
- 没有技术部分
- 见摘要
我想念什么?