All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nutz.web.ajax.AjaxCheckSession Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.67
Show newest version
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