REST サービスを公開します。
カテゴリ
データアクセス
構文
<xe:restService attributes>content</xe:restService>
表 1. 必須プロパティプロパティ |
説明 |
id |
デフォルトは restService1、restService2 などです。 |
pathInfo |
XPage を基準としたサービスのロケーションを識別します。 |
service |
公開されるサービス。 |
例
以下の例は、REST サービスを公開した後、ボタンを使用してサービスを呼び出し、その JSON 出力をローカルファイルシステムにリダイレクトします。
<xe:restService id="restService1" pathInfo="dbPathInfo">
<xe:this.service>
<xe:databaseCollectionJsonService></xe:databaseCollectionJsonService></xe:this.service>
</xe:restService>
<xp:button id="button1" value="Database Collection">
<xp:eventHandler event="onclick" submit="true">
<xp:this.action><![CDATA[#{javascript:
facesContext.getExternalContext().getResponse().sendRedirect(@FullUrl("restService.xsp/dbPathInfo"))
}]]></xp:this.action>
</xp:eventHandler>
</xp:button>