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

com.ajaxjs.mvc.view.AbstractUserLogin Maven / Gradle / Ivy

Go to download

AJAXJS Web aims to full-stack, not only the server-side framework, but also integrates the front-end library. It'€™s written in HTML5 + Java, a successor to the JVM platform, efficient, secure, stable, cross-platform and many other advantages, but it abandoned the traditional enterprise architecture brought about by the large and bloated, emphasizing the lightweight, and fast, very suitable for the Internet fast application.

There is a newer version: 1.3.0
Show newest version
package com.ajaxjs.mvc.view;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public abstract class AbstractUserLogin extends SimpleTagSupport {

	public static HttpServletRequest getRequest(JspContext context) {
		PageContext pageContext = (PageContext) context;
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

		return request;
	}

	/**
	 * 会员是否已经登录
	 * 
	 * @param request 请求对象
	 * @return true=會員已經登錄;fasle=未登录
	 */
	public static boolean isLogined(HttpServletRequest request) {
		return request != null && request.getSession() != null && request.getSession().getAttribute("userId") != null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy