title: Spring Security: How to force https with flag?
body: <p>With Spring security I configure the parts of my web app that need to be secured by https with <code>security:intercept-url</code> tag.</p>
  
  <p>For example:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;security:intercept-url pattern="/**/*secure*" requires-channel="https"/&gt;
  &lt;security:intercept-url pattern="/**" requires-channel="http" /&gt;    
  </code></pre>
  
  <p>This way all requests with "secure" in the file name or directories containing "secure" on the lowest level get https, the rest will get http.</p>
  
  <p>Is there a way to use a flag to make Spring force https?
  I could not get anything to work that takes stuff after the "?" of an url.</p>
  
  <ul>
  <li><code>http://domain/abc?secure=true</code> => https</li>
  <li><code>http://domain/abc =&gt; http</code></li>
  </ul>
  
  <p>Spring would then redirect transparently every request going to <code>http://domain/abc?secure=true</code> to <code>https://domain/abc?secure=true</code>.</p>
  
  <p>Is there a way to achieve that?
  The first pattern in the example achieves the result for a "secure" occuring before the "?", but I am looking for a solution/pattern to have a flag after the "?" only.</p>