【发布时间】:2018-10-10 10:38:36
【问题描述】:
现在我有一个带有函数的 Java 文件:
public void asd() throws SQLException {
try {
getConnections();
} catch (Exception ex) {
Logger.getLogger(PSTimer.class.getName()).log(Level.SEVERE, null, ex);
}
MongoCursor<Document> cursor = (MongoCursor<Document>) database.getCollection("Partidoscontagem").find().sort(new Document("data", -1)).limit(1).iterator();
if (cursor != null && cursor.hasNext()){
...
...
...
} else {
/*This is where I want to include the message "No document found"*/
}
而且我的 html 文件中有一个 p:commandButton 代码:
<p:commandButton actionListener="#{bean.asd()}">
我想知道在我单击 p:commandButton 后在我的 html 文件中弹出的正确方法,以及函数产生的文本。
【问题讨论】:
标签: javascript java html jsf