File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB Runtime Configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Runtime Configuration" Watch "EJB Runtime Configuration" New topic

EJB Runtime Configuration

Dan Fow

Joined: Apr 06, 2011
Posts: 4
I'm a newbie to JEE and I'm using an EJB to start a bean that calls a URL, I need some way of configuring that url at runtime.

If I was using spring I would just make the URL a constructor argument and initialize the bean in xml. However, I am using JEE.

Can someone tell me the proper way to make a bean have a configurable value in JEE 6?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You could read the value from somewhere.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 544
You can use environment entries.
They can be declared using <env-entry> element in ejb-jar.xml.

With EJB 3.0 you can inject them in the bean as you do in the Spring.


I agree. Here's the link:
subject: EJB Runtime Configuration
It's not a secret anymore!