I am trying to load a config.proprties file data in a Spring @Configuration
java class using @PropertySource
and Environment
variable.
Example: http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/PropertySource.html Issue is, I have a property which has value like:
serverName = abc\xyz
When I read this property by using method,
String server= env.getProprty("serverName");
System.out.print(server);
Value is printed as "abcxyz".
Please note that, I tried using double backslash like,
serverName = abc\\xyz
but still it is simply ignoring \ from the value string. Also I can not use forward slash in place of backslash.
Can you help me in fixing it? Thanks in advance!!