2016-12-16 10:54
public void intercept(Invocation inv) {
Controller con = inv.getController();
Object obj = con.getSession().getAttribute("uid");
if(obj == null){
if(METHOD.equals(inv.getMethodName())){
inv.invoke();
}else{
try {
con.getResponse().getWriter().write(LOGIN_URL);
con.renderNull();
} catch (IOException e) {
e.printStackTrace();
}
}
}else{
inv.invoke();
}
}