Class WebConfig
java.lang.Object
com.beassolution.rule.config.WebConfig
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
@EnableWebMvc
public class WebConfig
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Web configuration class for the Beas Rule Engine.
This class configures web-related settings including:
- Static resource handling
- CORS configuration for web requests
- Web MVC settings
The configuration enables proper handling of static resources and cross-origin requests for web clients.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Beas Solution Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCorsMappings
(org.springframework.web.servlet.config.annotation.CorsRegistry registry) Configures CORS settings for web requests.void
addResourceHandlers
(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Configures static resource handlers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
WebConfig
public WebConfig()
-
-
Method Details
-
addResourceHandlers
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Configures static resource handlers.This method sets up handlers for serving static resources from the classpath. It maps all requests to static resources located in the classpath:/static/ directory.
- Specified by:
addResourceHandlers
in 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 settings for web requests.This method sets up CORS configuration to allow cross-origin requests from any origin with all common HTTP methods. Credentials are disabled for security reasons.
- Specified by:
addCorsMappings
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
- Parameters:
registry
- CorsRegistry to configure
-