package com.roboy.Interceptor;
import javax.servlet.http.HttpSession;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
public class MyInterceptor implements Interceptor{
@Override
public void intercept(Invocation in) {
// TODO Auto-generated method stub
HttpSession session = in.getController().getSession();
if(session == null ){
in.getController().redirect("/login");
}
else{
String nickname = (String) session.getAttribute("username");
if(nickname != null ){
}else{
in.getController().redirect("/login");
}
}
}
}
项目:JFinal