Logo Questions Linux Laravel Mysql Ubuntu Git Menu

reading parameter from .properties file to .xml file

I have a application.xml file (directory = WEB-INF/application.xml)

and I have a jasperserver.properties file (directory = WEB-INF/internal/jasperserver.properties)

This is in the jasperserver.properties file


I want to read that "SERVICE_URL" property from the application.xml file

How do I do this ?

like image 973
Andre Avatar asked Mar 22 '23 21:03


1 Answers

use PropertyPlaceholderConfigurer in application.xml.

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="location">

to load properties file. Then use ${SERVICE_URL} in your application.xml to substitute values:

<bean class="your class">
  <property name="serviceURL"><value>${SERVICE_URL}</value></property>
like image 183
Luca Basso Ricci Avatar answered Apr 01 '23 09:04

Luca Basso Ricci