com.ajaxjs.mvc.view.AbstractUserLogin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ajaxjs-web Show documentation
Show all versions of ajaxjs-web Show documentation
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.
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;
}
}