What is the preferred way to specify an HTTP “Location” Response Header in Spring MVC 3?

前端 未结 5 817
名媛妹妹
名媛妹妹 2020-12-28 12:29

What is the preferred way to specify an HTTP \"Location\" Response Header in Spring MVC 3?

As far as I can tell, Spring will only provide a \"Location\" in response

5条回答
  •  难免孤独
    2020-12-28 13:20

    Your approach seems fine, but to keep it clean you could put the code inside a custom HandlerInterceptor that only triggers when there's an HTTP 201, for example.

    See here for more information.

提交回复
热议问题