我有一个属性类
@ConfigurationProperties(prefix = ShiroProperties.SHIRO_PREFIX)
public class ShiroProperties {
public static final String SHIRO_PREFIX = "shiro";
private String urlLogin;
private String urlSuccessed;
Run Code Online (Sandbox Code Playgroud)
和一个配置类
@Configuration
@EnableConfigurationProperties({ ShiroProperties.class })
public class ShiroConfig implements ApplicationContextAware {
ApplicationContext applicationContext;
@Autowired
private ShiroProperties shiroProperties ;
Run Code Online (Sandbox Code Playgroud)
shiroProperties 为空,但我可以在使用的 ShiroConfig 中找到它的值
applicationContext.getBean(ShiroProperties.class)
Run Code Online (Sandbox Code Playgroud)
我的应用程序类:
@SpringBootApplication
public class Bootstrap {
public static void main(String[] args) {
SpringApplication.run(Bootstrap.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
太奇怪了,我可以在其他项目中使用类似的代码成功运行,但是这个。
我有点困惑
// default charset utf8
val bytes = byteArrayOf(78, 23, 41, 51, -32, 42)
val str = String(bytes)
// there i got array [78, 23, 41, 51, -17, -65, -67, 42]
val weird = str.toByteArray()
Run Code Online (Sandbox Code Playgroud)
由于某种原因,我将随机值放入字节属性中。为什么不一致???