public class CheckSession implements ActionFilter {
** @Inject **
** private Dao dao;**
private String name;
private String path;
public CheckSession(String name, String path) {
this.name = name;
this.path = path;
}
public View match(ActionContext context) {
HttpSession session = Mvcs.getHttpSession(false);
if (session == null || null == session.getAttribute(name))
return new ServerRedirectView(path);
return null;
}
}