相关的东西如下:
src:

web.xml:

applicationContext.xml:

dispatcher-servlet.xml:

serviceImpl:

求各路大神支招,谢过啦.....
------解决思路----------------------
好像 使用 @Autowired 要在applicationContext.xml中定义与你变量同名的bean吧,这样Spring才能在启动的时候生成这个对象,然后@Autowired才能找到这个对象(我是新手 说的不对 您不要介意)
------解决思路----------------------
检查下是否是mapperlocations 那个自动扫描的问题,不行就把xml手动加进配置文件吧
------解决思路----------------------
配置文件scan里面没有扫描dao的目录,肯定注入失败
------解决思路----------------------
提供 get set方法 在set上 @Resource 试试看。。
------解决思路----------------------
UserDao配置了没?
@Repository
public class UserDao
{
//......
}
------解决思路----------------------
在service的实现类上方添加注解@Service 。
试试这个http://sabotage.lofter.com/post/b4493_208747
------解决思路----------------------
感谢楼主提醒,刚好遇到这个问题
配置的时候漏掉了监听器
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
只要监听到Servlet被创建,就加载Spring的核心配置文件applicationContext.xml