Spring MVC: Moving from WebMvcAutoConfiguration to WebMvcConfigurerAdapter, losing static pages -


with spring mvc application extends webmvcautoconfiguration, can serve static pages project-top-level directory "static", quite convenient. (spring seems package static pages in built jar file?)

but need more control on configuration, i'm instead extending application webmvcconfigureradapter. when this, lose static pages.

what's spring mvc way have cake , eat too? preferably without using xml (annotations , code)?

sure, depending on resources are, can add in webmvcconfigureradapter:

@override public void addresourcehandlers(resourcehandlerregistry registry) {     registry.addresourcehandler("/**")      .addresourcelocations("classpath:/meta-inf/resources/", "/path/to/other/resources") } 

that should resources going again. see here more details.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -