Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get <mvc:resources> working in Spring 3
    primarykey
    data
    text
    <p>Trying to link a css stylesheet to one of my jsp files, but I seem to be missing something because the stylesheet is never found.</p> <p>mvc-config.xml: </p> <pre><code>&lt;bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /&gt; &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt; &lt;mvc:annotation-driven /&gt; &lt;/beans&gt; </code></pre> <p>my link tag in jsp file</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="http://localhost/testing/resources/css/common.css"&gt; </code></pre> <p>web.xml:</p> <pre><code> &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; /WEB-INF/dispatcher-servlet.xml, /WEB-INF/datasource.xml, /WEB-INF/spring-security.xml, /WEB-INF/mvc-config.xml &lt;/param-value&gt; &lt;/context-param&gt; &lt;!-- Spring Security Filter --&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;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;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; </code></pre> <p>My folder structure is webapp/resources/css</p> <p>What am I missing? When I try to access the css file directly through the browser, it just redirects me to my jsp file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload