Hi.
Successfully deployed my first bean :)
Wondering about the difference when using the
<jsp:useBean bla bla >
Tag and:
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("java:comp/env/ejb/CartHome");
CartHome home = (CartHome)javax.rmi.PortableRemoteObject.narrow(obj,
CartHome.class);
This way of using a bean?
Thanks
Christer
> Wondering about the difference when using the
> <jsp:useBean bla bla >
This a pure Java Bean, it instantiates the class (not recommended with
EJB!).
> Tag and:
> InitialContext ctx = new InitialContext();
> Object obj = ctx.lookup("java:comp/env/ejb/CartHome");
> CartHome home = (CartHome)javax.rmi.PortableRemoteObject.narrow(obj,
> CartHome.class);
This uses an Enterprise JavaBean correctly via the JNDI reference.
-marek