Java ServletContext

前端 未结 5 808
遥遥无期
遥遥无期 2021-01-23 16:26

I have a JSP web site, not Spring MVC, and it has a config file web.xml.

There are a couple of settings within the web.xml file that I\'d like to get.

However, I

5条回答
  •  佛祖请我去吃肉
    2021-01-23 17:06

    This is not easily possible and may not be an elegent solution. The only option I can suggest is to have your configuration options i a xml or properties file and put it in your WEB-INF/classes directory so you can look it up using ClassLoader.getResource or ClassLoader.getResourceAsStream

    I know it may be a duplication of the configuration, but IMO its the elegent way.

提交回复
热议问题