ここで私の Java Jersey Rest サービスでは、更新メソッドの場合、値「money」はサーバーで long として表されます。有効な値は 30.00 から 500.00 の間です
どちらがより標準的なアプローチですか? クライアントにドットを使用して 30.00 として金額を送信させ、サーバーで手動で解析するように強制する必要があります。または 3000 として送信し、そのように解析します。または、Java/jerseylibrary でこれを行う方法が既にあります。
@PUT
@Path("/money")
@Consumes("text/plain)
public void updateThreshold(String threshold) {
*//check value and update in server*
}
注: パラメータ タイプを double に設定するためにパラメータ化されたリクエストを使用したくありません