JSP/servlet read parameters from properties file?

前端 未结 4 981
梦谈多话
梦谈多话 2020-12-31 22:34

My JSP pages need to display different information depending on which environment they\'re in (dev, production, sandbox, etc). I want to have a properties file for each of

4条回答
  •  时光取名叫无心
    2020-12-31 22:48

    I had the same problem. I was able to solve it by exposing the config file in my webmvc-config.xml file using a Resource Bundle:

    
    

    Then I was able to use it in my JSPs using a <spring:message /> tag:

    
    
    

提交回复
热议问题