foo.AccountHome, foo.Account"
!
//declare a "global" reference to an instance of the home interface of the session bean
AccountHome accHome=null;
public void jspInit()
{
//obtain an instance of the home interface
InitialContext cntxt = new InitialContext( );
Object ref= cntxt.lookup("java:comp/env/ejb/AccountEJB");
accHome = (AccountHome)PortableRemoteObject.narrow(ref,Accou ntHome.class);
}
//instantiate the session bean
Account acct = accHome.create();
//invoke the remote methods
acct.doWhatever(...);
// etc etc...
0 comments:
Post a Comment