I'm new to spring, so forgive the basic question, but I can't find the answer in either of the books on my desk, or in google.
I have a basic "Hello World" SLSB EJB which I am testing a simple client. The client contains the horrible code:
Using Spring, I still want to get these JNDI properties (the factory and the URL) into my application to tell it to use my JNDI. No clues from the books, but I finally figured to create a JndiTemplate and set autowire on the bean defining the SLSB proxy.
Properties p = new Properties();
return new InitialContext(p);
What I am wondering is, is this the correct approach, or is there some way of setting the "default" JndiTemplate in the framework and avoiding injecting the template into each bean using autowire (or maybe a different method).
<bean id="helloWorld" autowire="byName"
... etc ...
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory </prop>