のためにREST URLのためspring.data.rest.base・パス変数を使用して、私はすべての@Entity
ため@RestController
がREST URLが/api
としてではなくのためにapplication.peroperties
でspring.data.rest.base-path
変数セットを使用して正しく設定されているオブジェクトが作成されていません@RequestMapping("someEndpoint")
変数を使用していません。は@Controllerはもはや@RequestMapping
@Entity
クラスのユーザーのために
:
`http://localhost:8081/api/users'
しかし、私はsomeEndpoint
にアクセスしようとすると:
'http://localhost:8081/api/someEndpoint'
を私がの応答を取得
応答ステータス
HTTP/1.1 404 Not Found
ボディ代わりにRESTサービスのエンドポイントが
'http://localhost:8081/someEndpoint'
レスポンスに位置しています
"timestamp":1461267817272,"status":404,"error":"Not Found","message":"No message available","path":"/api/someEndpoint"}
:
HTTP/1.1 200 OK
Controllerクラス
@RestController
public class HomeController {
@RequestMapping(value = "/")
public String index() {
return "index";
}
@RequestMapping("someEndpoint")
public Stuff runSomething(
@RequestParam(value = "id", required = true) String id)
私の設定には何がありますか?
は
ありがとうございます。私はSpring Data RESTオブジェクトも混在させていますので、私は両方を使用します。 – ALM