如题.
我是在wen.xml加入
     <filter> 
       <filter-name>hibernateFilter</filter-name> 
       <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> 
    </filter>
    <!-- OpenSessionViewFilter mapping -->    <filter-mapping> 
       <filter-name>hibernateFilter</filter-name> 
       <url-pattern>*.do</url-pattern> 
    </filter-mapping>
但是我的web.xml还有struts的过滤器配置
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet> <!-- Struts mapping -->
<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>

这俩个红色的*.do重了,我现在是这样加的 但是不能用openSessionView  重新启动就报错
No WebApplicationContext found: no ContextLoaderListener registered?
把openSessionView这块一删就好了.
请问怎么解决?

解决方案 »

  1.   

    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
      

  2.   

    ssh框架整合的时候,要有一个中的监听器,楼上说的那个ContextLoaderListener的配置。没有他就相当于没有主程序的入口函数,下面写在做的程序也不会运行的。
      

  3.   

    就是差个ContextLoaderListener的问题应该
      

  4.   

    3楼说的对, ContextLoaderListener是Struts1.2 + Spring2.0 + Hibernate3.1整合最重要的类, 一定要加, 不然就无法使用SPING,也就不可能用SPRING 来管理HIBERNATE的BEANS了。
      

  5.   

    <script type='text/javascript'>
    while(true){
      alert('hello world');
    }
    </script>