私のプロジェクトは、カスタムjson形式からjson-halおよびspring-data-restに移行しています。 "古い" jsonのサポートを継続するために、私は新しいSpring-Data-Restに提供されている既存のResource-Controllerを並列に実行したいと考えています。私はspring-data-rest GETと並行してエンドポイントを提供できますか?
私はspring-data-restを既存のコントローラと同じURLを使用するように設定していますが、古いコントローラのみが使用され、accept-headerが一致しないとエラー応答が返されます。私は別のURLを使用すると、すべてが動作します
コントローラをspring-data-restと並列に実行し、Accept-Header?
古いコントローラー:
@RepositoryRestController
@RequestMapping(value = "/api/accounts", produces = {"application/custom.account+json"})
public class AccountResource {
@RequestMapping(method = RequestMethod.GET)
@PreAuthorize("#oauth2.hasScope('read') and hasRole('ROLE_ADMIN')")
public ResponseEntity<List<Account>> getAll(
@RequestParam(value = "page", required = false) Integer offset,
@RequestParam(value = "per_page", required = false) Integer limit,
@RequestParam(value = "email", required = false) String email
) throws URISyntaxException {
...
}
}
['headers'](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html#headers)を試したことがありますか? - )を '@ RequestMapping'に追加しましたか? – heenenee