Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HOw to get session variables between portlets ?

 
kala sagar
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
 
Shailesh Narkhede
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic