I have written an application that calls a service through Spring's RestTemplate.
It's working fine when I call the URL http://localhost:8081/index/myservice
directly.
I tried configuring an endpoint using application.properties
, how do I link it to the method calling the URL ? As it is now, It doesn't have any effect.
application.properties
app.endpoint = http://localhost:8081/index/
I want to directly call app.endpoint
instead of writing the URL.
Update : ApplicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Rest Template -->
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
</bean>
<bean id="properties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list><value>classpath:application.properties</value></list>
</property>