title: I can't use Spring filters in servlet-context XML
body: <p>For some reason both Eclipse and Spring can't find the filter tag (there is even a red mark)... What's wrong?</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:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
          http://www.springframework.org/schema/tx
          http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd
          http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
  
      &lt;bean
          class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"&gt;&lt;/bean&gt;
  
      &lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"
          destroy-method="close"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="jdbc:mysql://localhost/jacciseweb" /&gt;
          &lt;property name="username" value="root" /&gt;
          &lt;property name="password" value="siussi" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="mySessionFactory"
          class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="myDataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;it.jsoftware.jacciseweb.beans.Utente
                  &lt;/value&gt;
                  &lt;value&gt;it.jsoftware.jacciseweb.beans.Ordine
                  &lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt; org.hibernate.dialect.MySQLDialect
                  &lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;
                      true
                  &lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;
                      update
                  &lt;/prop&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  
  
      &lt;filter&gt;
          &lt;filter-name&gt;hibernateFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;
              org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
          &lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;singleSession&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;sessionFactoryBeanName&lt;/param-name&gt;
              &lt;param-value&gt;mySessionFactory&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
  
      &lt;!-- &lt;aop:config&gt; --&gt;
      &lt;!-- &lt;aop:pointcut id="productServiceMethods" --&gt;
      &lt;!-- expression="execution(* product.ProductService.*(..))" /&gt; --&gt;
      &lt;!-- &lt;aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods" 
          /&gt; --&gt;
      &lt;!-- &lt;/aop:config&gt; --&gt;
  
  
  
      &lt;bean id="acciseHibernateDao"
          class="it.jsoftware.jacciseweb.model.JAcciseWebManagementDaoHibernate"&gt;
          &lt;property name="sessionFactory" ref="mySessionFactory" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="transactionManager"
          class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="mySessionFactory" /&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven /&gt;
  
      &lt;bean id="acciseService"
          class="it.jsoftware.jacciseweb.model.JAcciseWebManagementServiceImpl"&gt;
          &lt;property name="dao" ref="acciseHibernateDao" /&gt;
      &lt;/bean&gt;
  
      &lt;context:component-scan base-package="it.jsoftware.jacciseweb.controllers"&gt;&lt;/context:component-scan&gt;
      &lt;mvc:annotation-driven /&gt;
      &lt;bean
          class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"
          p:synchronizeOnSession="true" /&gt;
  
      &lt;bean
          class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /&gt;
  
      &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  
      &lt;!-- non serve, è annotato --&gt;
      &lt;!-- &lt;bean name="/accise" class="it.jsoftware.jacciseweb.controllers.MainController"&gt; 
          &lt;/bean&gt; --&gt;
  
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>in particular it says "filter" is invalid content</p>