Skip to content

Request mappings

Mariusz Kopylec edited this page Jun 10, 2019 · 9 revisions

Request mapping is a configuration that defines which and how incoming requests will be forwarded. Multiple request mappings can be added. The configuration from previous section will use request mapping named all requests mapping to forward incoming requests. Every request mapping must be named. The request mapping which will handle the incoming request is chosen by a regular expression that defines incoming request paths. If path regular expression is not set then the configured request mapping will handle all incoming requests. Sample configuration of request mapping's path regular expression can look like this:

import static com.github.mkopylec.charon.configuration.CharonConfigurer.charonConfiguration;
import static com.github.mkopylec.charon.configuration.RequestMappingConfigurer.requestMapping;

@Configuration
class CharonConfiguration {

    @Bean
    CharonConfigurer charonConfigurer() {
        return charonConfiguration()
                .add(requestMapping("mapping name")
                        .pathRegex("/path/.*"));
    }
}

More things can be configured for request mapping. See further documentation for more details.

<< previous | next >>