• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving Data from Portal Session

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally in a JSP , to retrieve a session to list all the attributes in that session i would do

<%

Enumeration enume=session.getAttributeNames();

%>

I used this in my portal page and i am getting an exception "Cannot resolve symbol:variable session"


I am using websphere portal v6. Any suggestion would be welcome on how to retrieve portal Session
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I grabbed the code below from one of my free portlet development tutorials. You should check it out - it uses IRAD and deploys to WebSphere:

WebSphere Portlet Development Tutorials and JSR168 Code Samples

One thing you'll want to do is ensure that the session is available on the page with session="true" in the page directive:

<%@ page session="true" contentType="text/html" %>

From there, you'll want to use the <portlet efineObjects/> tag to make the portal variables available to the page.

And from there, you want to be using the portletSession in your JSPs, not the HttpSession.

Good luck!

-Cameron McKenzie


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic