title: Java Spring PropertyPlaceholderConfigurer and how to trim whitespaces/tabs in properties file
body: <p>I have a property file which is managed in classic way by PropertyPlaceholderConfigurer : </p>
  
  <pre><code>&lt;bean id="propertyConfigurer"    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; 
      &lt;property name="location" value="classpath:mail.properties" /&gt; 
  &lt;/bean&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&lt;bean id="jobDataPathUtils"    class="com.hello.test.DataPathUtils"&gt;
      &lt;property name="host" value="${smtp.host}" /&gt;
      &lt;property name="port" value="${smtp.port}" /&gt;
      &lt;property name="username" value="${smtp.user}" /&gt;
      &lt;property name="password" value="${smtp.pass}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The problem that i have a lots of <em>String</em> properties in .properties file, around 30 entries, and if someone adds a tabulation at the end of property value, the application fails to use correctly these properties. I would like to trim each property value before using it. I can do it manually using .trim() on each property in the DataPathUtils class, but i am wondering if there are any other ways to do this, either by PropertyPlaceholderConfigurer either ...? </p>
  
  <p>Thank you in advance,</p>