How can I pass init parameters to enterprise beans?

Robert Castaneda

You can specify Environment Entries that are accesssible by your EJB's. Inside your ejb-jar.xml you define the environment entries.


You can access the variable inside your EJB using the Environment Naming Context (in EJB 1.1)

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