Skip to Content
0
Former Member
Sep 21, 2005 at 11:33 AM

Urgent help required

20 Views

Hi all,

I have to get the userId and the user group in JSP.

I have included the following jars also in the par file:

com.sap.security.api.jar

prtapi.jar

the jsp is as follows:

<%@ page import="com.sap.netweaver.kmc.util.toolarea.EncoderDecoderHelper" %>

<%@ page import = "com.sapportals.portal.prt.session.IUserContext" %>

<%@ page import = "com.sap.security.api.IGroup" %>

<%@ page import = "com.sap.security.api.IGroupFactory" %>

<%@ page import = "com.sap.security.api.IUser" %>

<%@ page import = "com.sap.security.api.IUserAccount" %>

<%@ page import = "com.sap.security.api.UMFactory" %>

<%

try

{

IGroupFactory igf = UMFactory.getGroupFactory();

IGroup ig = igf.getGroupByUniqueName("Customers");

IUserContext user=componentRequest.getUser();

if(user!=null)

{

if (ig!=null && ig.isUserMember(user.getUniqueID(),true))

{

out.println("user in this group");

}

else

{

out.println("user not in this group");

}

}

else

{

out.println("user is null");

}

}

catch(Exception e)

{

out.println("exception!"+ e.printStackTrace());

}

%>

when i created an iView from this par file i am getting error saying :

error during rendering of jsp component.

can somebody tell me what could be the reason.

thanx and regards,

anuradha.