Setting properties in Web Applications

B

Bruno

Hi,

I know that in a standalone app, the Properties file should be used.
Also, when I'm using servlets, the method Servlet.getServletContext()
can help me out in setting these properties. But in my specific case,
I actually need to set the properties of some beans, not of a servlet.

For instance, I have a bean to access the persistent storage
layer, which is responsible for connecting and handling interactions
with the db. This bean needs to know the db username, url, etc in
order to get the work done. However, it is not a servlet, so it
doesn't make sense to turn it into one just to use the
getServletContext method.

So, the question is, how can those beans know their properties in a
Web app?

Thanks for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top