jsp - Spring MVC static resources in separate jar -
recently had question co-workers if can put our static resources(css, images, js) in separate jar file , access static resources spring mvc application. looking on google didn't find interesting. question is, possible? , if so, can please explain it.
thank you,
spring boot servers static resources form classpath:/resources/
, classpath:/static/
, classpath:/public/
(and more). if create jar file 1 folder in it("public"
example) static resources , put jar in classpath, content served.
if don't use boot, can configure application serve resources folder:
@override public void addresourcehandlers(resourcehandlerregistry registry) { registry .addresourcehandler("/resources/**") .addresourcelocations("/resources/","classpath:/public/"); }
Comments
Post a Comment