image-download - wrapping resource inside response entity
This commit is contained in:
parent
d2ca517fde
commit
fe22d59d06
|
@ -57,7 +57,9 @@ public class ImageController {
|
|||
|
||||
@RequestMapping(value = "/image-resource", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Resource getImageAsResource() {
|
||||
return new ServletContextResource(servletContext, "/WEB-INF/images/image-example.jpg");
|
||||
public ResponseEntity<Resource> getImageAsResource() {
|
||||
final HttpHeaders headers = new HttpHeaders();
|
||||
Resource resource = new ServletContextResource(servletContext, "/WEB-INF/images/image-example.jpg");
|
||||
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue