I hope I understand your issue.
The following sample codes to show how access ejb in your client.
Home home; // EJB home interface
private Home lookupHome()
throws NamingException
{
// Lookup the beans home using JNDI
Context ctx = getInitialContext(); // your codes
try {
Object home = ctx.lookup(JNDI_NAME);
return (Home) narrow(home, Home.class);
} catch (NamingException ne) {
log("The client was unable to lookup the EJBHome. Please make sure ");
log("that you have deployed the ejb with the JNDI name "+JNDI_NAME+" on the
WebLogic server at "+url);
throw ne;
}
}
home = lookupHome();
YourBean yourbean = (YourBean) narrow(home.create(), YourBean.class);
yourbean.yourmethod(); // call your EJB method.
Albert Pi
Corp IS System Delivery
516-803-3762
>>> Kher M <[EMAIL PROTECTED]> 03/05/02 12:28AM >>>
Hi,
When im looking up a home interface im putting
properties in the InitialContext.
My problem is how to access this in the enterprise
bean. I need to do this beacuse i need the language of
the client in the enterprise bean (without passing it
as a parameter to the bean). If i can get the user
name why cant i get all other parameters also in the
bean.
My requirement is to get the locale of the user in
the enterprise bean. I cant pass the locale as a
parameter to the method.
Somebody please reply as whether this can be done or
not.
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
properties.put(Context.LANGUAGE, "en");
new InitialContext(properties);
Regards
Cherry
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
==========================================================================To
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".