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

前端 未结 5 804
名媛妹妹
名媛妹妹 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:30

    According to: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30

    Absolute URI should be used:

    Location       = "Location" ":" absoluteURI  
    

    And the URI should be escaped properly:

    http://www.ietf.org/rfc/rfc2396.txt

提交回复
热议问题