[jboss-user] [JBoss Portal] - Re: How to access HttpSession Attributes in a portlet.

DanielWasser do-not-reply at jboss.com
Thu May 28 07:37:04 EDT 2009


You can try this:


        String sessId = null;
        HttpServletRequest httpServletRequest;
        try {
            httpServletRequest = getHttpServletRequest();
            HttpSession sess = httpServletRequest.getSession();

        } catch (Throwable e) {
            ....
        }


 /**
     * Obtains the HttpServletRequest of the user
     * 
     * @return
     * @throws PolicyContextException
     */
    protected HttpServletRequest getHttpServletRequest() throws PolicyContextException {
        HttpServletRequest request = (HttpServletRequest) PolicyContext
                .getContext("javax.servlet.http.HttpServletRequest");
        return request;
}

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233871#4233871

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233871



More information about the jboss-user mailing list