How can I read context parameter/web.xml values in a non-servlet java file?

后端 未结 5 1198
长发绾君心
长发绾君心 2020-12-28 17:46

I\'ve got a regular java file that I use to update and query a mysql database but I need to take configurable options in that file (like host name, password, etc) and put it

5条回答
  •  粉色の甜心
    2020-12-28 18:18

    One way is to read xml file and parse it.

    You can put it on some static map in after parsing in ServletContextListener

提交回复
热议问题