-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a36adc5
commit bbaddc7
Showing
1 changed file
with
9 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,14 @@ | |
import io.getlime.security.powerauth.rest.api.spring.annotation.support.PowerAuthEncryptionArgumentResolver; | ||
import io.getlime.security.powerauth.rest.api.spring.annotation.support.PowerAuthWebArgumentResolver; | ||
import io.getlime.security.powerauth.rest.api.spring.filter.PowerAuthRequestFilter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.io.Resource; | ||
import org.springframework.core.io.ResourceLoader; | ||
import org.springframework.core.io.UrlResource; | ||
import org.springframework.http.converter.HttpMessageConverter; | ||
import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean; | ||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | ||
|
@@ -52,6 +54,7 @@ | |
* @author Petr Dvorak, [email protected] | ||
*/ | ||
@Configuration | ||
@Slf4j | ||
public class WebMvcConfiguration implements WebMvcConfigurer { | ||
|
||
@Autowired | ||
|
@@ -140,7 +143,12 @@ public ReloadableResourceBundleMessageSourceWithListing messageSource() { | |
|
||
@Bean | ||
public Resource languageSettingSource() throws MalformedURLException { | ||
return resourceLoader.getResource(configuration.getResourcesLocation() + "lang.json"); | ||
Resource resource = resourceLoader.getResource(configuration.getResourcesLocation() + "lang.json"); | ||
if (!resource.exists()) { | ||
logger.info("The lang.json file was not found in {}, using default location", configuration.getResourcesLocation()); | ||
resource = new UrlResource("classpath:/static/resources/lang.json"); | ||
} | ||
return resource; | ||
} | ||
|
||
@Override | ||
|