tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Loucks <lou...@cofront.net>
Subject JNDI Namespace federation
Date Mon, 30 May 2005 17:32:49 GMT
Is there any way to pass parameters to an object factory? What I'm 
looking to do is have the object factory bound at "bean/mybean" and 
expose "foo=?,bar=?" to the getObjectInstance() method of 
test.MyBeanFactory to be used as initialization parameters.

The following doesn't work in tomcat, but it's more or less what I'd 
like to do:


<Resource
    name="bean/mybean"
    factory="test.MyBeanFactory"
    type="test.MyBean"
    auth="Container"/>





Context initCtx = new InitialContext();
Context ctx = (Context) initCtx.lookup("java:comp/env");

MyBean mybean1 = (MyBean) ctx.lookup("bean/mybean/foo=1,bar=xyz");
MyBean mybean2 = (MyBean) ctx.lookup("bean/mybean/foo=2,bar=abc");

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message