You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Peter Andersén <pe...@internetborder.se> on 2004/01/22 21:51:11 UTC

Getting userid and password

Hi
Is there a method in the jsp page to get username and password on the user logged in or ?
Because if i understand the jsp portlet it is for scripting jsp code ?

Sorry for my dumb question but im new to this stuff !

Peter

Re: Getting userid and password

Posted by Peter Andersén <pe...@internetborder.se>.
Thanks
Could you just clarify some stuff since im very new to jetspeed.
What do you mean by actionclass it is in my bean or ??

Thanks
Peter

----- Original Message ----- 
From: "Bela Kovac" <wi...@uni-paderborn.de>
To: "Jetspeed Users List" <je...@jakarta.apache.org>
Sent: Friday, January 23, 2004 8:44 PM
Subject: Re: Getting userid and password


Am 22.01.2004 um 21:51 schrieb Peter Andersén:

> Is there a method in the jsp page to get username and password on the
> user logged in or ?

There is a way to get L and P from the user logged in (in a JSP
portlet):

The action class should look something like this:


package yourClassesInHere.modules.actions.portlets;

import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
import org.apache.jetspeed.portal.Portlet;
import org.apache.jetspeed.util.PortletSessionState;
import org.apache.turbine.util.RunData;

public class YourPortletAction extends JspPortletAction {
     protected void buildNormalContext(Portlet portlet, RunData rundata)
{
         String uid    = (String) rundata.getUser().getUserName();
         String passwd = (String) rundata.getUser().getPassword();
         rundata.getRequest().setAttribute("passwd", passwd);
         rundata.getRequest().setAttribute("uid", uid);
     }
}


while in the corresponding .jsp there should be some lines like:


<%
String sUid        = (String) request.getAttribute("uid");
String sPasswd     = (String) request.getAttribute("passwd");
%>

UID: <%= sUid %><br>
PassWD: <%= sPasswd %>


Hope this helps.


Bela

-- 
"Der Blitzableiter auf einem Kirchturm ist das denkbar stärkste
Misstrauensvotum gegen den lieben Gott."
   -- Karl Kraus


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: Getting userid and password

Posted by Bela Kovac <wi...@uni-paderborn.de>.
Am 22.01.2004 um 21:51 schrieb Peter Andersén:

> Is there a method in the jsp page to get username and password on the 
> user logged in or ?

There is a way to get L and P from the user logged in (in a JSP 
portlet):

The action class should look something like this:


package yourClassesInHere.modules.actions.portlets;

import org.apache.jetspeed.modules.actions.portlets.JspPortletAction;
import org.apache.jetspeed.portal.Portlet;
import org.apache.jetspeed.util.PortletSessionState;
import org.apache.turbine.util.RunData;

public class YourPortletAction extends JspPortletAction {
     protected void buildNormalContext(Portlet portlet, RunData rundata) 
{
         String uid    = (String) rundata.getUser().getUserName();
         String passwd = (String) rundata.getUser().getPassword();
         rundata.getRequest().setAttribute("passwd", passwd);
         rundata.getRequest().setAttribute("uid", uid);
     }
}


while in the corresponding .jsp there should be some lines like:


<%
String sUid        = (String) request.getAttribute("uid");
String sPasswd     = (String) request.getAttribute("passwd");
%>

UID: <%= sUid %><br>
PassWD: <%= sPasswd %>


Hope this helps.


Bela

-- 
"Der Blitzableiter auf einem Kirchturm ist das denkbar stärkste 
Misstrauensvotum gegen den lieben Gott."
   -- Karl Kraus


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org