securityManager设置realm之后,realm再设置matcher,怎么生效的?
CustomRealm customRealm = new CustomRealm(); DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager(); // 设置realm defaultSecurityManager.setRealm(customRealm); HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(); matcher.setHashAlgorithmName("md5"); matcher.setHashIterations(1); // 设置matcher customRealm.setCredentialsMatcher(matcher); SecurityUtils.setSecurityManager(defaultSecurityManager);