title: web.xml security-constraint is not returning back to http from https
body: <p>I following the procedure as told in this link <a href="https://stackoverflow.com/questions/1330187/use-https-only-for-certain-pages-in-tomcat-webapp">Use HTTPS only for certain pages in servlet based webapp</a>. My webpage is normally on http, but when i click on login page it goes to https. This is all fine. But i when i successfully login and the page goes back to regular home page for example the https still remains. It does not go back to http. Please help.</p>
  
  <p>Added web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          id="WebApp_ID" version="2.5"&gt;
          &lt;display-name&gt;Welcome&lt;/display-name&gt;
          &lt;servlet&gt;
                  &lt;servlet-name&gt;dispatcher&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;servlet-mapping&gt;
                  &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
                  &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;
  
          &lt;servlet-mapping&gt;
                  &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
                  &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;
  
          &lt;security-constraint&gt;
                  &lt;web-resource-collection&gt;
                          &lt;web-resource-name&gt;https&lt;/web-resource-name&gt;
                          &lt;url-pattern&gt;/signin.htm&lt;/url-pattern&gt;
                          &lt;url-pattern&gt;/login.htm&lt;/url-pattern&gt;
                          &lt;url-pattern&gt;/shownewuser.htm&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;
  
          &lt;security-constraint&gt;
                  &lt;web-resource-collection&gt;
                          &lt;web-resource-name&gt;http&lt;/web-resource-name&gt;
                          &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
                  &lt;/web-resource-collection&gt;
                  &lt;user-data-constraint&gt;
                          &lt;transport-guarantee&gt;NONE&lt;/transport-guarantee&gt;
                  &lt;/user-data-constraint&gt;
          &lt;/security-constraint&gt;
      &lt;listener&gt;
              &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;context-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;
                      /WEB-INF/dispatcher-servlet.xml,
                      /WEB-INF/spring-security.xml
              &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Spring Security --&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;springSecurityFilterChain&lt;/filter-name&gt;
              &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  
  
      &lt;welcome-file-list&gt;
              &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  </code></pre>
  
  <p></p>