|
33 | 33 | import org.springframework.aot.AotDetector; |
34 | 34 | import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
35 | 35 | import org.springframework.beans.factory.config.ConfigurableBeanFactory; |
| 36 | +import org.springframework.beans.factory.config.EmbeddedValueResolver; |
36 | 37 | import org.springframework.cglib.core.SpringNamingPolicy; |
37 | 38 | import org.springframework.cglib.proxy.Callback; |
38 | 39 | import org.springframework.cglib.proxy.Enhancer; |
|
54 | 55 | import org.springframework.util.ReflectionUtils; |
55 | 56 | import org.springframework.util.ReflectionUtils.MethodFilter; |
56 | 57 | import org.springframework.util.StringUtils; |
57 | | -import org.springframework.util.SystemPropertyUtils; |
58 | 58 | import org.springframework.web.bind.annotation.RequestMapping; |
59 | 59 | import org.springframework.web.context.WebApplicationContext; |
60 | 60 | import org.springframework.web.context.request.RequestAttributes; |
@@ -629,14 +629,13 @@ private static CompositeUriComponentsContributor getUriComponentsContributor() { |
629 | 629 | } |
630 | 630 |
|
631 | 631 | private static String resolveEmbeddedValue(String value) { |
632 | | - if (value.contains(SystemPropertyUtils.PLACEHOLDER_PREFIX)) { |
633 | | - WebApplicationContext webApplicationContext = getWebApplicationContext(); |
634 | | - if (webApplicationContext != null && |
635 | | - webApplicationContext.getAutowireCapableBeanFactory() instanceof ConfigurableBeanFactory cbf) { |
636 | | - String resolvedEmbeddedValue = cbf.resolveEmbeddedValue(value); |
637 | | - if (resolvedEmbeddedValue != null) { |
638 | | - return resolvedEmbeddedValue; |
639 | | - } |
| 632 | + WebApplicationContext webApplicationContext = getWebApplicationContext(); |
| 633 | + if (webApplicationContext != null && |
| 634 | + webApplicationContext.getAutowireCapableBeanFactory() instanceof ConfigurableBeanFactory cbf) { |
| 635 | + EmbeddedValueResolver embeddedValueResolver = new EmbeddedValueResolver(cbf); |
| 636 | + String resolvedEmbeddedValue = embeddedValueResolver.resolveStringValue(value); |
| 637 | + if (resolvedEmbeddedValue != null) { |
| 638 | + return resolvedEmbeddedValue; |
640 | 639 | } |
641 | 640 | } |
642 | 641 | return value; |
|
0 commit comments