debug发现principals未null?可是我在自己的service里面是可以获取到principals。
public static Callable<Object> GET_USER_ID = new Callable<Object>() {
public Object call() throws Exception {
Object u;
try {
u = SecurityUtils.getSubject().getPrincipal();
} catch (Throwable e) {
return Integer.valueOf(-1);
}
if (u != null) {
return u.toString();
}
return Integer.valueOf(0);
};
};