title: Reference a CSS in Spring Boot
body: <p>I have a Boot Application with Java Configuration but without ThymeLeaf and I am having trouble referencing CSS in my JSP page.
  When I start up the application, I see this in Browser Console.</p>
  <pre><code>localhost/:1 Refused to apply style from 'http://localhost:8080/SheridanSports/css/nav.css' because its MIME type ('application/json') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
  </code></pre>
  <p><strong>This is the structure of the Project</strong></p>
  <p><a href="https://i.stack.imgur.com/qAP2K.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qAP2K.jpg" alt="enter image description here" /></a></p>
  <p>index.jsp</p>
  <pre><code>&lt;head&gt;
      &lt;title&gt;Spring Sports-Home&lt;/title&gt;
      &lt;base href=&quot;/&quot;&gt;
      &lt;link href=&quot;${pageContext.request.contextPath}/css/nav.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
  &lt;/head&gt;
  </code></pre>
  <p>AppConfig.java</p>
  <pre><code>@Configuration
  @EnableWebMvc
  //@ComponentScan(basePackages = &quot;com.abc.SheridanSportsWAR&quot;)
  public class AppConfig implements WebMvcConfigurer{
      
      @Bean
      public ViewResolver viewResolver() {
          
          InternalResourceViewResolver bean = new InternalResourceViewResolver();
          
          bean.setPrefix(&quot;/WEB-INF/view/&quot;);
          bean.setSuffix(&quot;.jsp&quot;);
          
          return bean;
      }   
  }
  </code></pre>