I\'m new to Spring framework and Spring Boot.
I\'ve implemented a very simple RESTful Spring Boot web application.
You can see the nearly full source code in another
I see from another of your questions that what you actually want is to be able to change the path to static resources in your application from the default values. Leaving aside the question of why you would want to do that, there are several possible answers.
@Bean
of type WebMvcConfigurerAdapter
and use the addResourceHandlers()
method to add additional paths to static resources (see WebMvcAutoConfiguration
for the defaults). ConfigurableEmbeddedServletContainerFactory
features to set the servlet context root path. @Bean
definition of type EmbeddedServletContainerFactory
that set up the servlet container in the way you want it. If you use one of the existing concrete implementations they extend the Abstract*
class that you already found, so they even have a setter for a property called documentRoot
. You can also do a lot of common manipulations using a @Bean
of type EmbeddedServletContainerCustomizer
.