| Author |
HOw to get session variables between portlets ?
|
kala sagar
Greenhorn
Joined: Feb 25, 2010
Posts: 7
|
|
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
Joined: Jul 10, 2008
Posts: 323
|
|
Hi Kala,
can you please post code you tried?
|
Thanks,
Shailesh
|
 |
kala sagar
Greenhorn
Joined: Feb 25, 2010
Posts: 7
|
|
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
Joined: Jul 10, 2008
Posts: 323
|
|
only required code from portlet which is giving problem...
|
 |
kala sagar
Greenhorn
Joined: Feb 25, 2010
Posts: 7
|
|
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
Joined: Jul 10, 2008
Posts: 323
|
|
Hi Sagar,
session.setAttribute("userName",req.getParameter("username"), PortletSession.APPLICATION_SCOPE);
try this...
get more in from HERE
|
 |
kala sagar
Greenhorn
Joined: Feb 25, 2010
Posts: 7
|
|
If i am adding that APPLICATION_SCOPE it's giving error
compilation error.
|
 |
Shailesh Narkhede
Ranch Hand
Joined: Jul 10, 2008
Posts: 323
|
|
Post your full portlet java file.
jsut want to see source with imports of classes.
|
 |
 |
|
|
subject: HOw to get session variables between portlets ?
|
|
|