title: Spring security blocks css, js files from being loaded on jsp page
body: <p>i'm working on a login operations using spring security, everything works fine but the login page is loaded with no corresponding style sheets files.</p>
  
  <p>This is my <strong>spring-security.xml</strong> configuration file.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
          xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd
              http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
          &lt;security:http security="none" pattern="/resources/**"&gt;&lt;/security:http&gt;
          &lt;security:http security="none" pattern="/resources/css/*"&gt;&lt;/security:http&gt;
          &lt;security:http security="none" pattern="/resources/js/*"&gt;&lt;/security:http&gt;
  
          &lt;security:http auto-config="true"&gt;
              &lt;security:intercept-url pattern="/login" access="permitAll"/&gt;
              &lt;security:intercept-url pattern="/entry.html"
                  access="hasRole('ROLE_USER')" /&gt;
              &lt;security:form-login login-page="/login"
                  default-target-url="/entry.html" authentication-failure-url="/login?error"
                  username-parameter="username" password-parameter="password" /&gt;
              &lt;security:logout logout-success-url="/login?logout"&gt;&lt;/security:logout&gt;
              &lt;security:csrf/&gt;
          &lt;/security:http&gt;
  
          &lt;security:authentication-manager&gt;
              &lt;security:authentication-provider&gt;
                  &lt;security:user-service&gt;
                      &lt;security:user name="user" password="123456"
                          authorities="ROLE_USER"&gt;&lt;/security:user&gt;
                  &lt;/security:user-service&gt;
              &lt;/security:authentication-provider&gt;
          &lt;/security:authentication-manager&gt;
  
      &lt;/beans&gt;
  </code></pre>
  
  <p><strong>login.jsp</strong></p>
  
  <pre><code>    &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;title&gt;Login Page&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css"
          href="&lt;%=request.getContextPath()%&gt;/resources/css/bootstrap.min.css"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-4"&gt;&lt;/div&gt;
                  &lt;div class="col-md-4"&gt;
                      &lt;div class="login-panel panel panel-default"&gt;
                          &lt;div class="panel-heading"&gt;
                              &lt;h3 class="panel-title"&gt;Login with Username and Password&lt;/h3&gt;
                          &lt;/div&gt;
                          &lt;div class="panel-body"&gt;
                              &lt;c:if test="${not empty error}"&gt;
                                  &lt;div class="error"&gt;${error}&lt;/div&gt;
                              &lt;/c:if&gt;
                              &lt;c:if test="${not empty msg}"&gt;
                                  &lt;div class="msg"&gt;${msg}&lt;/div&gt;
                              &lt;/c:if&gt;
                              &lt;form name='loginForm'
                                  action="&lt;c:url value='j_spring_security_check' /&gt;" method="post"&gt;
                                  &lt;fieldset&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;input class="form-control" placeholder="Username ..."
                                              name="username" type="text" /&gt;
                                      &lt;/div&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;input class="form-control" placeholder="Password ..."
                                              name="password" type="password" /&gt;
                                      &lt;/div&gt;
                                      &lt;div&gt;
                                          &lt;input type="submit" value="Login" class="btn btn-success"
                                              name="submit" /&gt;
                                      &lt;/div&gt;
                                  &lt;/fieldset&gt;
                                  &lt;input type="hidden" name="${_csrf.parameterName}"
                                      value="${_csrf.token}" /&gt;
                              &lt;/form&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="col-md-4"&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>I have no idea why it's not loading css files, i tried to provide all the possible authorities to the files existing in the resources folder but with no result.</p>