Package edu.tufts.hrilab.gui
Class WebMvcConfig
java.lang.Object
edu.tufts.hrilab.gui.WebMvcConfig
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
public class WebMvcConfig
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Web MVC Configuration for handling CORS policies and static resource locations.
Customizes the Spring MVC framework for specific needs such as handling CORS and serving static resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCorsMappings(org.springframework.web.servlet.config.annotation.CorsRegistry registry) Configures CORS mappings to allow cross-origin requests to specific paths.voidaddResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Configures resource handlers to serve static resources.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addFormatters, addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
Constructor Details
-
WebMvcConfig
public WebMvcConfig()
-
-
Method Details
-
addResourceHandlers
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Configures resource handlers to serve static resources. This method maps URL patterns to physical paths.- Specified by:
addResourceHandlersin interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer- Parameters:
registry- ResourceHandlerRegistry to configure.
-
addCorsMappings
public void addCorsMappings(org.springframework.web.servlet.config.annotation.CorsRegistry registry) Configures CORS mappings to allow cross-origin requests to specific paths.- Specified by:
addCorsMappingsin interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer- Parameters:
registry- CorsRegistry to configure.
-