現在做的ssm專案中,驗證用的是security,第一次用這個,在自定義AccessDecisionVoter類時,
package jp.go.kokusen.pionet.common.security;
import java.util.Collection;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.FilterInvocation;
public class CustomAccessDecisionVoter implements AccessDecisionVoter<Object> {
@Override
public boolean supports(ConfigAttribute attribute) {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean supports(Class<?> clazz) {
// TODO Auto-generated method stub
return true;
}
@Override
public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes) {
for (ConfigAttribute attribute : attributes) {
if(attribute.getAttribute() == null){
continue;
}
if (this.supports(attribute)) {
}
}
return result;
}
}
attribute.getAttribute() 這個方法的回傳值一直是空的?
這個地方是做什么用的
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/134464.html
標籤:Web 開發
