Recently I had a question from my co-workers if we can put our static resources(css, images, js) in separate jar file and access this static resources from spring mvc application. I was looking on google but i didn't find anything interesting. So my question is, is possible? and if so, can you please explain who to do it.
Thank you,
Spring Boot servers the static resources form
classpath:/resources/
,classpath:/static/
andclasspath:/public/
(and some more). So if you create a jar file with one folder in it("public"
for example) with all your static resources and put that jar in the classpath, all that content will be served.If you don't use Boot, you can configure your application to serve the resources from that folder: