• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HOw to get session variables between portlets ?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,

i am using gridsphere portlet container 2.2.10 and deployed pure JSR 168 portlets. I need to use user name and password which i entered in login portlet in JSR 168 portlet.for that i set a session variables userName and Password . But oin JSR 168 Portlet it's displaying value "null" .
To invoke JSR 168 container is using one servlet PortletInvoker.java .How can i do it.? please help me. Thanks in advance.


sagar
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kala,

can you please post code you tried?

 
kala sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

how can i post all grid sphere container code. It's a nearly 20mb file and having many java files .If you need my JSR 168 portlet then i will send .


Thanks and Regards
sagar
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
only required code from portlet which is giving problem...
 
kala sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


in container i set session.setAttribute("userName",req.getParameter("username"));

in my JSR 168 portlet i am trying to get session.getAttribute("userName");

this value is coming "null"

pelase help me


Thanks and Regards
sagar
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sagar,

session.setAttribute("userName",req.getParameter("username"), PortletSession.APPLICATION_SCOPE);

try this...

get more in from HERE
 
kala sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i am adding that APPLICATION_SCOPE it's giving error


compilation error.
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your full portlet java file.
jsut want to see source with imports of classes.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic