Hi there, I am newish to Spring and Java
I have an spring boot / thymeleaf app where I can add a product, which contains some product info and an image.
When I edit a product, if I change the image, I redirect back to the same page, however even though the new image is successfully uploaded, it is not showing up (error 404 and type of image is json), but I can for example inspect the image src and open that source and actually see the image, and also if I again refresh the page (after the initial redirect) the image is there.
So the image is there but it is simply not showing up upon initial redirect.
Relevant code from the POST request:
The GET request (the redirect url)
In the view I render the image like so:
in chrome when I inspect network/img, I can see that upon the redirect the image is of type json(this is when the image is not showing up), and then when I refresh again and the image does show - then the type is jpg
guess the problem is that the image is of type json, why is it of type json, maybe I am not saving the image correctly?