问题内容:
解决方法一:可能在web.xml中没有启动spring容器,加上如下代码即可
<!-- 1.启动spring容器-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext/applicationContext.xml</param-value>
</context-param>
<!--设置监听器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
解决方法二:可能没有给service层加入@service注解,在spring.xml配置文件中进行了包扫描,前提是将各层加入注解可以被spring扫描到
@Service
public class EmployeeService {
}