Example usage for javax.servlet.http HttpSession getAttribute

List of usage examples for javax.servlet.http HttpSession getAttribute

Introduction

In this page you can find the example usage for javax.servlet.http HttpSession getAttribute.

Prototype

public Object getAttribute(String name);

Source Link

Document

Returns the object bound with the specified name in this session, or null if no object is bound under the name.

Usage

From source file:com.hangum.tadpole.session.manager.SessionManager.java

public static String getTimezone() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (String) sStore.getAttribute(NAME.TIMEZONE.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

/**
 * get login ip type/*from www . j  a  v a2s  .c o  m*/
 * 
 * @param getLoginIpType
 */
public static String getLoginIpType() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (String) sStore.getAttribute(NAME.LOGIN_IP_TYPE.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

/**
 * get login ip/*w ww. j av  a2 s .c o  m*/
 * @return
 */
public static String getLoginIp() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (String) sStore.getAttribute(NAME.LOGIN_IP.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

public static Integer getLimitAddDBCnt() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (Integer) sStore.getAttribute(NAME.LIMIT_ADD_DB_CNT.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

/**
 * ??  ? .//from w  w  w  .j  a v a  2s  . co  m
 * 
 * <pre>
 *  ? 
 * admin? manager? . 
 *    1) admin
 *  2) manager 
 *  3) dba 
 *  4) user
 * 
 * group manager? ? .
 * manager? ? ?   .
 * </pre>
 * 
 * @return
 */
public static String getRepresentRole() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (String) sStore.getAttribute(NAME.REPRESENT_ROLE_TYPE.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

public static int getUserSeq() {
    HttpSession sStore = RWT.getRequest().getSession();
    Object obj = sStore.getAttribute(NAME.USER_SEQ.name());

    if (obj == null)
        return 0;
    else//  w w  w  .ja va 2  s  . co m
        return (Integer) obj;
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

public static String getEMAIL() {
    HttpSession sStore = RWT.getRequest().getSession();

    return (String) sStore.getAttribute(NAME.LOGIN_EMAIL.name());
}

From source file:com.hangum.tadpole.session.manager.SessionManager.java

public static Timestamp getServiceEnd() {
    HttpSession sStore = RWT.getRequest().getSession();
    return (Timestamp) sStore.getAttribute(NAME.SERVICE_END.name());
}

From source file:be.fedict.eid.idp.webapp.ProtocolEntryServlet.java

public static String getProtocolServiceContextPath(HttpServletRequest request) {
    HttpSession httpSession = request.getSession();
    return (String) httpSession.getAttribute(CONTEXT_PATH_SESSION_ATTRIBUTE);
}

From source file:controller.InternshipController.java

/**
 * Apply for an offer//  w ww. j a  va2  s.  c  om
 * @param application
 * @param model
 * @param session
 * @return 
 */
@RequestMapping(value = "/FileUpload", method = RequestMethod.POST)
public static String applyInternship(@ModelAttribute("SpringWeb") docs.ApplicationModel application,
        ModelMap model, HttpSession session) {

    System.out.println("Dans le APPLY");
    if (session.getAttribute("userID") != null) {
        int idUser = (int) session.getAttribute("userID");
        STUDENTTYPE user = BusControl.getStudentbyId(idUser);
        application.setFirstName((String) user.getFIRSTNAME());
        application.setLastName((String) user.getLASTNAME());
        application.setMail((String) user.getMAIL());
        System.out.println(application.getMail());

        System.out.println("L'intenrshipID " + application.getInternshipID());
        System.out.println("CV FIRST NAME : " + application.getCvPath());
        System.out.println("CL FIRST NAME : " + application.getClPath());
        System.out.println("APPLY FIRST NAME : " + application.getFirstName());
        System.out.println("APPLY MAIL : " + application.getMail());
        BusControl.addNewApplicant(application);

        Utils.drawHomePage(session.getAttribute("userName").toString(),
                BusControl.getNotifications(idUser).getNOTIFS().size(), "searchStudent", "internshipDetail",
                model);
        return "home";

    } else {
        model.addAttribute("errormessage", " You need to be authenticated. ");
        return "connection";
    }
}