• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

getInitParameter with a MessageDrivenBean

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a way to retrieve some intialization parameters for my MessageDrivenBean. If this was a servlet I would put the info into the web.xml file and then call servletContext.getInitParameter("X") where "X" was the name of my parameter in web.xml. Is there a comparable place to store these types of parameters for a MessageDrivenBean and what method do I call to get them?

Thanks for the help.

- Ben
 
Ben Hagadorn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it. This is what I needed to do:


Add entries to my ejb-jar.xml file:

<env-entry>
<env-entry-name>SMTPMailServer</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>internalmail.ourcompany.com</env-entry-value>
</env-entry>


Add code to my MessageDrivenBean:

String SMTPMailServer = (String)ctx.lookup("java:comp/env/SMTPMailServer");
 
There is no "i" in denial. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic