In my UI code, i have a link to a css stylesheet with href="url for spring controller".
I want the Spring Controller to return the CSS file which the UI page uses for styling.
First i was wondering, if this was even possible?, and secondly what the Spring Controller needs to return? Do i need to return a byte[] representation of the css file and put it in a ResponseEntity, or use some kind of outputstream on the Servlet response?
Something like?
@RequestMapping(value = "/getCSS/{userId}", method= RequestMethod.GET, produces={"text/css"})
@ResponseStatus(HttpStatus.OK)
public ??? getCSS(){
}
The UI code and Spring app which has the controller are not part of the same project.
Different users have different stylings, and the Spring app, gets the users css file from a database. Therefore, the css file cannot simply be put into the /static folder or /resources folder as there will be different css files for different users.