-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db6d45c
commit be49cb4
Showing
8 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 15 additions & 11 deletions
26
batch-boot-jpa-sample/src/main/java/com/example/bootbatchjpa/config/WebMvcConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
package com.example.bootbatchjpa.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.lang.NonNull; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class WebMvcConfig implements WebMvcConfigurer { | ||
private final ApplicationProperties properties; | ||
@Configuration(proxyBeanMethods = false) | ||
class WebMvcConfig implements WebMvcConfigurer { | ||
private final ApplicationProperties applicationProperties; | ||
|
||
WebMvcConfig(ApplicationProperties applicationProperties) { | ||
this.applicationProperties = applicationProperties; | ||
} | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping(properties.getCors().getPathPattern()) | ||
.allowedMethods(properties.getCors().getAllowedMethods()) | ||
.allowedHeaders(properties.getCors().getAllowedHeaders()) | ||
.allowedOriginPatterns(properties.getCors().getAllowedOriginPatterns()) | ||
.allowCredentials(properties.getCors().isAllowCredentials()); | ||
public void addCorsMappings(@NonNull CorsRegistry registry) { | ||
ApplicationProperties.Cors propertiesCors = applicationProperties.getCors(); | ||
registry.addMapping(propertiesCors.getPathPattern()) | ||
.allowedMethods(propertiesCors.getAllowedMethods()) | ||
.allowedHeaders(propertiesCors.getAllowedHeaders()) | ||
.allowedOriginPatterns(propertiesCors.getAllowedOriginPatterns()) | ||
.allowCredentials(propertiesCors.isAllowCredentials()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
...a-sample/src/main/java/com/example/bootbatchjpa/web/controllers/JobInvokerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters