title: Redirect http to https is not working
body: <p>I want to redirect Http to Https.  So for that I created a certificate using 'keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -storepass password' this command. </p>
  
  <h2>pom.xml</h2>
  
  <pre><code> &lt;plugin&gt;
              &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;warSourceDirectory&gt;${webappDirectory}&lt;/warSourceDirectory&gt;
                  &lt;path&gt;bigdata&lt;/path&gt;
                  &lt;stopPort&gt;9966&lt;/stopPort&gt;
                  &lt;stopKey&gt;foo&lt;/stopKey&gt;
                  &lt;httpsPort&gt;8443&lt;/httpsPort&gt;
                  &lt;keystoreFile&gt;/usr/local/Keystorefiles/keystore.jks&lt;/keystoreFile&gt;
                  &lt;keystorePass&gt;arya123&lt;/keystorePass&gt;
                  &lt;password&gt;arya123&lt;/password&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <h2>web.xml</h2>
  
  <pre><code>&lt;security-constraint&gt;
  &lt;web-resource-collection&gt;
  &lt;web-resource-name&gt;securedapp&lt;/web-resource-name&gt;
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/web-resource-collection&gt;
  &lt;user-data-constraint&gt;
  &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
  &lt;/user-data-constraint&gt;
  &lt;/security-constraint&gt;
  </code></pre>
  
  <h2>Server.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Server address="localhost" port="8005" shutdown="SHUTDOWN"&gt;
    &lt;Listener className="org.apache.catalina.core.JasperListener"/&gt;
  &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/&gt;
  &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/&gt;
  &lt;Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/&gt;
    &lt;GlobalNamingResources&gt;
        &lt;Resource auth="Container" description="User database  that        can    be  updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"  name="UserDatabase" pathname="conf/tomcat-users.xml"  type="org.apache.catalina.UserDatabase"/&gt;
    &lt;/GlobalNamingResources&gt;
    &lt;Service name="Catalina"&gt;
     &lt;Connector address="dt" connectionTimeout="20000" port="8080"  protocol="HTTP/1.1" redirectPort="8443"/&gt;
        &lt;!-- &lt;Connector executor="tomcatThreadPool"
             port="8080" protocol="HTTP/1.1"
             connectionTimeout="20000" redirectPort="8443" /&gt;--&gt;
  &lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
             maxThreads="150" scheme="https" secure="true"
             clientAuth="false" sslProtocol="TLS"
      keystoreFile="/usr/local/Keystorefiles/keystore.jks"
             keystorePass="arya123" /&gt;
  
   &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/&gt;
   &lt;Engine defaultHost="dt" name="Catalina"&gt;
   &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/&gt;
    &lt;/Realm&gt;
   &lt;Host appBase="webapps" autoDeploy="true" name="dt" unpackWARs="true"&gt;
    &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" prefix="localhost_access_log." suffix=".txt"/&gt;
  
    &lt;Context docBase="HelloWeb" path="/HelloWeb" reloadable="true" source="org.eclipse.jst.jee.server:HelloWeb"/&gt;&lt;Context docBase="SpringMVCExample" path="/SpringMVCExample" reloadable="true" source="org.eclipse.jst.jee.server:SpringMVCExample"/&gt;&lt;Context docBase="TrialApp" path="/TrialApp" reloadable="true" source="org.eclipse.jst.jee.server:TrialApp"/&gt;&lt;Context docBase="ABDFver3" path="/bigdata" reloadable="true" source="org.eclipse.jst.jee.server:ABDFver3"/&gt;&lt;/Host&gt;
  &lt;/Engine&gt;
  &lt;/Service&gt;
   &lt;/Server&gt;
  </code></pre>
  
  <p>This much I did. But when I  gave URL it doesn't redirect to Https. Could anyone help me?</p>