#85 spring mvc taglib的checkbox, radio 支持twitter bootstrap

This commit is contained in:
Calvin
2012-09-01 01:25:05 +08:00
parent 7cdbe51d1a
commit a5446be3bb
11 changed files with 5384 additions and 26 deletions
@@ -64,15 +64,20 @@ public class ShiroDbRealm extends AuthorizingRealm {
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
ShiroUser shiroUser = (ShiroUser) principals.fromRealm(getName()).iterator().next();
User user = accountService.findUserByLoginName(shiroUser.loginName);
if (user != null) {
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
info.addRoles(user.getRoleList());
return info;
} else {
Object principal = principals.getPrimaryPrincipal();
if (principal == null) {
return null;
}
ShiroUser shiroUser = (ShiroUser) principal;
User user = accountService.findUserByLoginName(shiroUser.loginName);
if (user == null) {
return null;
}
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
info.addRoles(user.getRoleList());
return info;
}
/**
@@ -13,7 +13,8 @@ public class QuickStartServer {
public static final int PORT = 8080;
public static final String CONTEXT = "/quickstart";
public static final String BASE_URL = "http://localhost:8080/quickstart";
public static final String[] TLD_JAR_NAMES = new String[] { "sitemesh", "spring-webmvc", "shiro-web" };
public static final String[] TLD_JAR_NAMES = new String[] { "sitemesh", "spring-webmvc", "shiro-web",
"springside-core" };
public static void main(String[] args) throws Exception {
//设定Spring的profile