org.nutz.web.ajax.AjaxCheckSession Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz-web Show documentation
Show all versions of nutz-web Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.web.ajax;
import org.nutz.mvc.ActionContext;
import org.nutz.mvc.ActionFilter;
import org.nutz.mvc.Mvcs;
import org.nutz.mvc.View;
import org.nutz.mvc.view.ViewWrapper;
public class AjaxCheckSession implements ActionFilter {
private String name;
public AjaxCheckSession(String name) {
this.name = name;
}
public View match(ActionContext context) {
Object obj = Mvcs.getHttpSession().getAttribute(name);
if (null == obj) {
View v = new AjaxView();
AjaxReturn re = Ajax.expired();
return new ViewWrapper(v, re);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy