Example usage for javax.servlet.http HttpServletRequest getSession

List of usage examples for javax.servlet.http HttpServletRequest getSession

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getSession.

Prototype

public HttpSession getSession();

Source Link

Document

Returns the current session associated with this request, or if the request does not have a session, creates one.

Usage

From source file:org.tsm.concharto.auth.AuthHelper.java

public static boolean isUserInSession(HttpServletRequest request) {
    HttpSession session = request.getSession();
    return (null != session.getAttribute(AuthConstants.SESSION_AUTH_USERNAME));
}

From source file:irille.pub.verify.RandomImageServlet.java

public static String getRandomLoginKey(HttpServletRequest req) {
    return (String) req.getSession().getAttribute(RANDOM_LOGIN_KEY);
}

From source file:egovframework.com.ext.jfile.session.SessionUploadChecker.java

public static boolean isContainsKey(HttpServletRequest request, String fileId) {
    return sessionMap.containsKey(request.getSession().getId() + "_" + fileId);
}

From source file:alfio.controller.support.SessionUtil.java

public static Optional<String> retrieveSpecialPriceCode(HttpServletRequest request) {
    return Optional.ofNullable((String) request.getSession().getAttribute(SPECIAL_PRICE_CODE));
}

From source file:alfio.controller.support.SessionUtil.java

public static Optional<String> retrievePromotionCodeDiscount(HttpServletRequest request) {
    return Optional.ofNullable((String) request.getSession().getAttribute(PROMOTIONAL_CODE_DISCOUNT));
}

From source file:alfio.controller.support.SessionUtil.java

public static Optional<String> retrieveSpecialPriceSessionId(HttpServletRequest request) {
    return Optional.ofNullable((String) request.getSession().getAttribute(SPECIAL_PRICE_CODE_SESSION_ID));
}

From source file:edu.cornell.mannlib.vitro.webapp.beans.DisplayMessage.java

/**
 * Store this message on the session. This will overwrite any previously
 * stored message.//from   ww  w  . j  av a 2s  .com
 */
public static void setMessage(HttpServletRequest request, String message) {
    setMessage(request.getSession(), message);
}

From source file:com.mobileman.projecth.web.util.CaptchaUtil.java

static public boolean verify(HttpServletRequest request, Model model, String answer) {
    Captcha captcha = (Captcha) request.getSession().getAttribute(Captcha.NAME);
    if (captcha.isCorrect(answer)) {
        return true;
    }//from w  ww  .j a v  a2  s .  c  om
    model.addAttribute(KEY_ERROR, true);
    return false;
}

From source file:ServletUtils.java

/**
 * Returns the file specified by <tt>path</tt> as returned by
 * <tt>ServletContext.getRealPath()</tt>.
 *//* w  ww.  j a  v a 2  s . com*/
public static File getRealFile(HttpServletRequest request, String path) {

    return new File(request.getSession().getServletContext().getRealPath(path));
}

From source file:com.nabla.wapp.server.general.UserSession.java

public static UserSession load(final HttpServletRequest request) {
    return (UserSession) request.getSession().getAttribute(SESSION_PARAMETER_NAME);
}