2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <[email protected]>: > Hi > > I have a context-param in my web.xml file that I access using > getInitParameter in Servlet context. > > For normal HTTP requests I have a ServletContextListener that fires an > event on contextInitialized and an @Application scoped bean that stores the > context so I from other places can access the context-param. > > I want to be able to access this context-param also when an Message Driven > Bean, MDB, is called. > > Questions: > > 1. Is there any guarantees that the ServletContextListener will receive an > event (containing the ServletContext) before the first MDB call if NO http > requests has been made?
MDB is started before web container is started so no but if you are sure you can't get any message (JMS) that's fine > 2. If the answer to the above is NO should I then move this parameter out > of web.xml and place it somewhere else? Any suggestions to where? > Can be in ejb-jar.xml or env-entries.properties as MDB env entry > Regards > LF > > -- > Med vänlig hälsning / Best regards > > Lars-Fredrik Smedberg > > STATEMENT OF CONFIDENTIALITY: > The information contained in this electronic message and any > attachments to this message are intended for the exclusive use of the > address(es) and may contain confidential or privileged information. If > you are not the intended recipient, please notify Lars-Fredrik Smedberg > immediately at [email protected], and destroy all copies of this > message and any attachments.
