title: How can I use boolean parameters from application.properties in spring security context configuration xml file?
body: <p>I am trying to use a <code>boolean</code> parameter from my <code>application.properties</code> in my <code>spring-security configuration xml</code> file. 
  I don't know why I can use not-boolean parameters, but I get an error for boolean.</p>
  
  <p>How can I use boolean parameters?</p>
  
  <p>Here is my application.properties: <br></p>
  
  <pre><code>JDBC_CONNECTION_STRING=jdbc:mysql://localhost:3306/schema?user=username&amp;password=password
  protocol=http
  USE_SECURE=false
  </code></pre>
  
  <p>My spring-security.xml is: <br> </p>
  
  <pre><code>&lt; remember-me user-service-ref="internalUserDetails" data-source-ref="dataSource" key="this-is-my-key02203452416fw" use-secure-cookie="${USE_SECURE}" /&gt;
  </code></pre>
  
  <p>...
  but I get this error:
  cvc-datatype-valid.1.2.1: '${USE_SECURE}' is not a valid value for 'boolean'</p>
  
  <p>I have also tried to set <code>USE_SECURE=False</code> but I get the same error again.
  How can I use boolean parameters in the spring security configuration xml file?</p>
  
  <p>Here is my web.xml:<br></p>
  
  <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0" &gt;
  
      &lt;display-name&gt; Name-MyApp&lt;/display-name&gt; 
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;!-- Servlets --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;MyApp&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- Servlets Mappings --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;MyApp&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
                  /WEB-INF/servlet-context.xml,
              /WEB-INF/spring-security.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Filters --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;httpMethodFilter&lt;/filter-name&gt;
          &lt;servlet-name&gt;MyApp&lt;/servlet-name&gt;
      &lt;/filter-mapping&gt;    
  
      &lt;filter&gt; 
          &lt;filter-name&gt;httpMethodFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.HiddenHttpMethodFilter&lt;/filter-class&gt;
      &lt;/filter&gt; 
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  &lt;/web-app&gt; 
  </code></pre>