67,512
社区成员
发帖
与我相关
我的任务
分享
public class AuthorityInterceptor extends AbstractInterceptor {
public AuthorityInterceptor() {
// TODO Auto-generated constructor stub
}
private Logger log = Logger.getLogger(AuthorityInterceptor.class);
@Override
public String intercept(ActionInvocation invocation) throws Exception {
ActionContext context = invocation.getInvocationContext();
Map session = context.getSession();
TabUsers user =null;
if (session.get("managerEntity") != null) {
user = (TabUsers) session.get("managerEntity");
log.info("拦截器捕获.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + user.getNickname());
}
if (user == null) {
return new RedirectResult("/backmanager/first/edit.do").toString();
} else {
//return "/home/index";
return invocation.invoke();
}
}
}
@Action("/backmanager/home/first/${type}/edit.do")
public String createframe() {
String realPath = getServletRequest().getRealPath("/");
contentService.setPath(realPath + "backmanager/content/content.xml");
log.info(" --" + contentService.getPath());
listContent = contentService.getList(type);
return "index";
}