on 04-08-2008 3:57 PM
Hi All,
Can anyone help to determine the current user id entered in the portal for login through a composite application service?
Is there any way of getting the IUser object without knowing the unique id?
We are working with CE 7.1
Thanks in advance.
Regards,
Srinivasan Subbiah
Hi,
It is CAF. But context is not visible.
How can i get the context and also how to get request object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You get the Context via the below Annotation
@Resource
private SessionContext context;
So, your code will look something like this....
public class TestBeanImpl extends com.sap.demo.modeled.appsrv.service.TestBean {
@Resource
private SessionContext context;
@com.sap.caf.dt.CAFOperation(name = "getStatusSummaryByUser")
public String com.sap.demo.types.StatusSummaryList getCARStatusSummary()
{
String userId = context.getCallerPrincipal().getName();
return ("Hello " + userId);
}
}
Not sure what you mean by "request"....
Rao
within CAF or a JEE (EJB project), you can use the below statement to get the userId....
String userName = context.getCallerPrincipal().getName();
Rao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.