PropertyOverrideConfigurer 在 Spring Boot 2.4.4 中不工作,但在 1.5.3 中工作

问题描述

以下代码适用于 Spring boot 1.5.3,但在 2.4.4 中失败

    @DependsOn({"redirectStrategy"})
    public PropertyOverrideConfigurer propertyOverrideConfigurer() {
        PropertyOverrideConfigurer p = new PropertyOverrideConfigurer();
        Properties properties = new Properties();
        properties.setProperty("redirectStrategy.contextRelative","true");
        p.setProperties(properties);
        return p;
    }
    
    @Bean
    public DefaultRedirectStrategy redirectStrategy(){
        return new DefaultRedirectStrategy();
    }

失败并出现以下错误

Description:

A component required a bean named 'redirectStrategy' that Could not be found.


Action:

Consider defining a bean named 'redirectStrategy' in your configuration.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)