继续关注。这个是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <description>
Spring App Examples.
</description>
<!--servlet>
<servlet-name>hello</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping-->
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
</web-app>

解决方案 »

  1.   

    我也出现了这个问题,有兴趣可以看下我的帖子
    http://community.csdn.net/Expert/topic/4753/4753573.xml?temp=.9650232
      

  2.   

    我看了一下,修改了一下web.xml如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <description>
    Spring App Examples.
    </description> <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContext*.xml</param-value>
        </context-param>
        <!--listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener-->   
    <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>还是出现同样的错误,就是listener没有办法加载
      

  3.   

    http://community.csdn.net/Expert/topic/4656/4656079.xml?temp=.2610895参考上面的帖子,问题可以解决。不过后面我又出了其它问题.
    我也学习spring,有问题可以发消息给我。
      

  4.   

    你看看tomcat的日志,有可能是spring的bean的问题
      

  5.   

    感谢finalguyi。。
    把listener换掉是可以了,但是这样并没有治标,还是没有用到listener。
    有没有那位能够提供一个spring的用户管理的例子。
      

  6.   

    能不用listener ,最好不要用,
      

  7.   

    到这里看看,www.oksonic.cn或是 http://oksonic.blogjava.net
    jsf + spring + hibernate的例子中有。