title: I can show images in a SPRING 3 MVC project
body: <p>I can`t show images in a Spring 3 MVC project. I don´t find the error and have been reading a lot of tutorials. My code is the next:</p>
  
  <p><strong>dispatcher-servlet</strong></p>
  
  <pre><code>&lt;mvc:annotation-driven /&gt;
  &lt;mvc:resources location="/resources/" mapping="/resources/**"/&gt;
  
  &lt;context:property-placeholder location="classpath:jdbc.properties" /&gt;
  &lt;context:component-scan base-package="com.barrancofv" /&gt;
  &lt;tx:annotation-driven transaction-manager="hibernateTransactionManager"/&gt;
  
      &lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="localeChangeInterceptor"
      class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt;
      &lt;property name="paramName" value="lang" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="localeResolver"
      class="org.springframework.web.servlet.i18n.CookieLocaleResolver"&gt;
      &lt;property name="defaultLocale" value="es"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="handlerMapping"
      class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt;
      &lt;property name="interceptors"&gt;
          &lt;ref bean="localeChangeInterceptor" /&gt;
      &lt;/property&gt;
      &lt;/bean&gt;    
  
      &lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
      &lt;property name="basenames"&gt;
          &lt;list&gt;
              &lt;value&gt;mymessages&lt;/value&gt;
              &lt;value&gt;messages&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="${database.driver}" /&gt;
      &lt;property name="url" value="${database.url}" /&gt;
      &lt;property name="username" value="${database.user}" /&gt;
      &lt;property name="password" value="${database.password}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="annotatedClasses"&gt;
      &lt;list&gt;
          &lt;value&gt;com.barrancofv.model.Empleado&lt;/value&gt;
          &lt;value&gt;com.barrancofv.model.Documento&lt;/value&gt;
      &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;     
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&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;
  
  &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;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;
  </code></pre>
  
  <p><strong>Security.xml</strong> </p>
  
  <pre><code>&lt;http use-expressions="true"&gt;
      &lt;!-- intercept-url seguridad de flujo de paginas --&gt;
      &lt;intercept-url pattern="/welcome" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/*" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/*/" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/*/*" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/*/*/" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/welcome/*/*/*/*" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/resources/**" access="permitAll" /&gt;
      &lt;form-login login-page="/login" default-target-url="/welcome" authentication-failure-url="/loginfailed" /&gt;
      &lt;logout logout-success-url="/logout" /&gt;
  &lt;/http&gt;
  </code></pre>
  
  <p><strong>In my login.jsp</strong></p>
  
  <p>To put my image, I use this:  </p>
  
  <pre><code>&lt;img src="&lt;c:url value="/resources/img/a.jpg" alt="" /&gt;
  </code></pre>
  
  <p>My structure is:</p>
  
  <pre><code>src/main/resources/images/a.jpg
  </code></pre>
  
  <p>I don´t find the error. Thanks!!!</p>