java - Reading already loaded properties in a jsp? -


my jsp pages need display different information depending on environment they're in (dev, production, sandbox, etc). want have properties file each of these environments contain parameters might need. how can reference properties file in jsp page? using spring , loading properties below. have in applicationcontext.xml file.

how can loaded properties jsp?

<bean id="proconfigpropertyfactory" class="org.springframework.beans.factory.config.propertiesfactorybean">         <property name="locations">             <list>                   <value>file:/somefolder/some.properties</value>             </list>         </property>     </bean> 

inject properties in controller, , store in model:

@autowired @qualifier("proconfigpropertyfactory") private properties configproperties;  public modelandview somemethod() {     return new modelandview("thejspname", "configproperties", configproperties); } 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -